Title: [108868] trunk/Tools
Revision
108868
Author
dpra...@chromium.org
Date
2012-02-24 16:30:36 -0800 (Fri, 24 Feb 2012)

Log Message

webkitpy: changelog_unittest test_fuzzy_reviewer_match is slow
https://bugs.webkit.org/show_bug.cgi?id=79258

Reviewed by Ryosuke Niwa.

Split the fuzzy matching into separate functions so that they
can be sharded and run in parallel.

Also, fix a bug in the svn_blame_regexp that was causing us
to require ChangeLog lines to have at least one space after the
author, making the code require trailing whitespace in the
changelog in some places (this was making my life harder because
I have my text editor set to strip trailing whitespace in python
files, and that was causing test_parse_log_entries_from_changelog() to fail
when the whitespace on line 275 was removed).

* Scripts/webkitpy/common/checkout/changelog.py:
(ChangeLog):
* Scripts/webkitpy/common/checkout/changelog_unittest.py:
(test_fuzzy_reviewer_match__none):
(test_fuzzy_reviewer_match_adam_barth):
(test_fuzzy_reviewer_match_darin_adler_et_al):
(test_fuzzy_reviewer_match_dimitri_glazkov):
(test_fuzzy_reviewer_match_george_staikos):
(test_fuzzy_reviewer_match_mark_rowe):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (108867 => 108868)


--- trunk/Tools/ChangeLog	2012-02-25 00:26:48 UTC (rev 108867)
+++ trunk/Tools/ChangeLog	2012-02-25 00:30:36 UTC (rev 108868)
@@ -1,5 +1,33 @@
 2012-02-24  Dirk Pranke  <dpra...@chromium.org>
 
+        webkitpy: changelog_unittest test_fuzzy_reviewer_match is slow
+        https://bugs.webkit.org/show_bug.cgi?id=79258
+
+        Reviewed by Ryosuke Niwa.
+
+        Split the fuzzy matching into separate functions so that they
+        can be sharded and run in parallel.
+
+        Also, fix a bug in the svn_blame_regexp that was causing us
+        to require ChangeLog lines to have at least one space after the
+        author, making the code require trailing whitespace in the
+        changelog in some places (this was making my life harder because
+        I have my text editor set to strip trailing whitespace in python
+        files, and that was causing test_parse_log_entries_from_changelog() to fail
+        when the whitespace on line 275 was removed).
+
+        * Scripts/webkitpy/common/checkout/changelog.py:
+        (ChangeLog):
+        * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+        (test_fuzzy_reviewer_match__none):
+        (test_fuzzy_reviewer_match_adam_barth):
+        (test_fuzzy_reviewer_match_darin_adler_et_al):
+        (test_fuzzy_reviewer_match_dimitri_glazkov):
+        (test_fuzzy_reviewer_match_george_staikos):
+        (test_fuzzy_reviewer_match_mark_rowe):
+
+2012-02-24  Dirk Pranke  <dpra...@chromium.org>
+
         webkitpy: committers_unittest fuzzy matching is really slow
         https://bugs.webkit.org/show_bug.cgi?id=79179
 

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/changelog.py (108867 => 108868)


--- trunk/Tools/Scripts/webkitpy/common/checkout/changelog.py	2012-02-25 00:26:48 UTC (rev 108867)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/changelog.py	2012-02-25 00:30:36 UTC (rev 108868)
@@ -263,7 +263,7 @@
             entry_lines.append(line)
         return None # We never found a date line!
 
-    svn_blame_regexp = re.compile(r'^(\s*(?P<revision>\d+) [^ ]+)\s(?P<line>.*?\n)')
+    svn_blame_regexp = re.compile(r'^(\s*(?P<revision>\d+) [^ ]+)\s*(?P<line>.*?\n)')
 
     @staticmethod
     def _separate_revision_and_line(line):

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py (108867 => 108868)


--- trunk/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py	2012-02-25 00:26:48 UTC (rev 108867)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py	2012-02-25 00:30:36 UTC (rev 108868)
@@ -250,39 +250,40 @@
         self.assertEquals(parsed_entries[8].reviewer_text(), 'Darin Adler')
 
     def test_parse_log_entries_from_annotated_file(self):
-        changelog_file = StringIO(u'''100000 o...@webkit.org 2011-11-11  Csaba Osztrogon\u00e1c  <o...@webkit.org>
-100000 o...@webkit.org 
-100000 o...@webkit.org         100,000 !!!
-100000 o...@webkit.org 
-100000 o...@webkit.org         Reviewed by Zoltan Herczeg.
-100000 o...@webkit.org 
-100000 o...@webkit.org         * ChangeLog: Point out revision 100,000.
-100000 o...@webkit.org
-93798 a...@apple.com 2011-08-25  Alexey Proskuryakov  <a...@apple.com>
-93798 a...@apple.com 
-93798 a...@apple.com         Fix build when GCC 4.2 is not installed.
-93798 a...@apple.com 
-93798 a...@apple.com         * gtest/xcode/Config/CompilerVersion.xcconfig: Copied from Source/WebCore/Configurations/CompilerVersion.xcconfig.
-93798 a...@apple.com         * gtest/xcode/Config/General.xcconfig:
-93798 a...@apple.com         Use the same compiler version as other projects do.
-93798 a...@apple.com
-99491 andreas.kl...@nokia.com 2011-11-03  Andreas Kling  <kl...@webkit.org>
-99491 andreas.kl...@nokia.com 
-99190 andreas.kl...@nokia.com         Unreviewed build fix, sigh.
-99190 andreas.kl...@nokia.com 
-99190 andreas.kl...@nokia.com         * css/CSSFontFaceRule.h:
-99190 andreas.kl...@nokia.com         * css/CSSMutableStyleDeclaration.h:
-99190 andreas.kl...@nokia.com 
-99190 andreas.kl...@nokia.com 2011-11-03  Andreas Kling  <kl...@webkit.org>
-99190 andreas.kl...@nokia.com 
-99187 andreas.kl...@nokia.com         Unreviewed build fix, out-of-line StyleSheet::parentStyleSheet()
-99187 andreas.kl...@nokia.com         again since there's a cycle in the includes between CSSRule/StyleSheet.
-99187 andreas.kl...@nokia.com 
-99187 andreas.kl...@nokia.com         * css/StyleSheet.cpp:
-99187 andreas.kl...@nokia.com         (WebCore::StyleSheet::parentStyleSheet):
-99187 andreas.kl...@nokia.com         * css/StyleSheet.h:
-99187 andreas.kl...@nokia.com 
-''')
+        # Note that there are trailing spaces on some of the lines intentionally.
+        changelog_file = StringIO(u"100000 o...@webkit.org 2011-11-11  Csaba Osztrogon\u00e1c  <o...@webkit.org>\n"
+            u"100000 o...@webkit.org\n"
+            u"100000 o...@webkit.org         100,000 !!!\n"
+            u"100000 o...@webkit.org \n"
+            u"100000 o...@webkit.org         Reviewed by Zoltan Herczeg.\n"
+            u"100000 o...@webkit.org \n"
+            u"100000 o...@webkit.org         * ChangeLog: Point out revision 100,000.\n"
+            u"100000 o...@webkit.org \n"
+            u"93798 a...@apple.com 2011-08-25  Alexey Proskuryakov  <a...@apple.com>\n"
+            u"93798 a...@apple.com \n"
+            u"93798 a...@apple.com         Fix build when GCC 4.2 is not installed.\n"
+            u"93798 a...@apple.com \n"
+            u"93798 a...@apple.com         * gtest/xcode/Config/CompilerVersion.xcconfig: Copied from Source/WebCore/Configurations/CompilerVersion.xcconfig.\n"
+            u"93798 a...@apple.com         * gtest/xcode/Config/General.xcconfig:\n"
+            u"93798 a...@apple.com         Use the same compiler version as other projects do.\n"
+            u"93798 a...@apple.com\n"
+            u"99491 andreas.kl...@nokia.com 2011-11-03  Andreas Kling  <kl...@webkit.org>\n"
+            u"99491 andreas.kl...@nokia.com \n"
+            u"99190 andreas.kl...@nokia.com         Unreviewed build fix, sigh.\n"
+            u"99190 andreas.kl...@nokia.com \n"
+            u"99190 andreas.kl...@nokia.com         * css/CSSFontFaceRule.h:\n"
+            u"99190 andreas.kl...@nokia.com         * css/CSSMutableStyleDeclaration.h:\n"
+            u"99190 andreas.kl...@nokia.com\n"
+            u"99190 andreas.kl...@nokia.com 2011-11-03  Andreas Kling  <kl...@webkit.org>\n"
+            u"99190 andreas.kl...@nokia.com \n"
+            u"99187 andreas.kl...@nokia.com         Unreviewed build fix, out-of-line StyleSheet::parentStyleSheet()\n"
+            u"99187 andreas.kl...@nokia.com         again since there's a cycle in the includes between CSSRule/StyleSheet.\n"
+            u"99187 andreas.kl...@nokia.com \n"
+            u"99187 andreas.kl...@nokia.com         * css/StyleSheet.cpp:\n"
+            u"99187 andreas.kl...@nokia.com         (WebCore::StyleSheet::parentStyleSheet):\n"
+            u"99187 andreas.kl...@nokia.com         * css/StyleSheet.h:\n"
+            u"99187 andreas.kl...@nokia.com \n")
+
         parsed_entries = list(ChangeLog.parse_entries_from_file(changelog_file))
         self.assertEquals(parsed_entries[0].revision(), 100000)
         self.assertEquals(parsed_entries[0].reviewer_text(), "Zoltan Herczeg")
@@ -390,17 +391,27 @@
         self.assertEquals(reviewer_text_list, expected_text_list)
         self.assertEquals(self._entry_with_reviewer(reviewer_text).reviewers(), self._contributors(expected_contributors))
 
-    def test_fuzzy_reviewer_match(self):
-        self._assert_fuzzy_reviewer_match('Reviewed by Dimitri Glazkov, build fix', ['Dimitri Glazkov', 'build fix'], ['Dimitri Glazkov'])
+    def test_fuzzy_reviewer_match__none(self):
         self._assert_fuzzy_reviewer_match('Reviewed by BUILD FIX', ['BUILD FIX'], [])
         self._assert_fuzzy_reviewer_match('Reviewed by Mac build fix', ['Mac build fix'], [])
+
+    def test_fuzzy_reviewer_match_adam_barth(self):
+        self._assert_fuzzy_reviewer_match('Reviewed by Adam Barth.:w', ['Adam Barth.:w'], ['Adam Barth'])
+
+    def test_fuzzy_reviewer_match_darin_adler_et_al(self):
+        self._assert_fuzzy_reviewer_match('Reviewed by Darin Adler in <https://bugs.webkit.org/show_bug.cgi?id=47736>.', ['Darin Adler in'], ['Darin Adler'])
         self._assert_fuzzy_reviewer_match('Reviewed by Darin Adler, Dan Bernstein, Adele Peterson, and others.',
             ['Darin Adler', 'Dan Bernstein', 'Adele Peterson', 'others'], ['Darin Adler', 'Dan Bernstein', 'Adele Peterson'])
+
+    def test_fuzzy_reviewer_match_dimitri_glazkov(self):
+        self._assert_fuzzy_reviewer_match('Reviewed by Dimitri Glazkov, build fix', ['Dimitri Glazkov', 'build fix'], ['Dimitri Glazkov'])
+
+    def test_fuzzy_reviewer_match_george_staikos(self):
         self._assert_fuzzy_reviewer_match('Reviewed by George Staikos (and others)', ['George Staikos', 'others'], ['George Staikos'])
+
+    def test_fuzzy_reviewer_match_mark_rowe(self):
         self._assert_fuzzy_reviewer_match('Reviewed by Mark Rowe, but Dan Bernstein also reviewed and asked thoughtful questions.',
             ['Mark Rowe', 'but Dan Bernstein also reviewed', 'asked thoughtful questions'], ['Mark Rowe'])
-        self._assert_fuzzy_reviewer_match('Reviewed by Darin Adler in <https://bugs.webkit.org/show_bug.cgi?id=47736>.', ['Darin Adler in'], ['Darin Adler'])
-        self._assert_fuzzy_reviewer_match('Reviewed by Adam Barth.:w', ['Adam Barth.:w'], ['Adam Barth'])
 
     def _assert_parse_authors(self, author_text, expected_contributors):
         parsed_authors = [(author['name'], author['email']) for author in self._entry_with_author(author_text).authors()]
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to