Title: [120454] trunk/Tools
Revision
120454
Author
dpra...@chromium.org
Date
2012-06-15 07:22:13 -0700 (Fri, 15 Jun 2012)

Log Message

webkit-patch rebaseline-expectations should only rebaseline the appropriate suffixes for the failure in question
https://bugs.webkit.org/show_bug.cgi?id=88581

Reviewed by Adam Barth.

Make sure we only optimize the suffixes we rebaselined during
rebaseline-expectations, and not all suffixes for a test.
While optimizing is somewhere between harmless and good, it's also confusing :)

* Scripts/webkitpy/tool/commands/rebaseline.py:
(RebaselineExpectations._rebaseline_port):
(RebaselineExpectations.execute):
* Scripts/webkitpy/tool/commands/rebaseline_unittest.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (120453 => 120454)


--- trunk/Tools/ChangeLog	2012-06-15 14:17:29 UTC (rev 120453)
+++ trunk/Tools/ChangeLog	2012-06-15 14:22:13 UTC (rev 120454)
@@ -1,3 +1,19 @@
+2012-06-15  Dirk Pranke  <dpra...@chromium.org>
+
+        webkit-patch rebaseline-expectations should only rebaseline the appropriate suffixes for the failure in question
+        https://bugs.webkit.org/show_bug.cgi?id=88581
+
+        Reviewed by Adam Barth.
+
+        Make sure we only optimize the suffixes we rebaselined during
+        rebaseline-expectations, and not all suffixes for a test.
+        While optimizing is somewhere between harmless and good, it's also confusing :)
+
+        * Scripts/webkitpy/tool/commands/rebaseline.py:
+        (RebaselineExpectations._rebaseline_port):
+        (RebaselineExpectations.execute):
+        * Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
+
 2012-06-15  Csaba Osztrogonác  <o...@webkit.org>
 
         Update builder.html template for newer buildmaster

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py (120453 => 120454)


--- trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py	2012-06-15 14:17:29 UTC (rev 120453)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py	2012-06-15 14:22:13 UTC (rev 120454)
@@ -284,22 +284,22 @@
             return
         _log.info("Retrieving results for %s from %s." % (port_name, builder_name))
         for test_name, suffixes in self._tests_to_rebaseline(self._tool.port_factory.get(port_name)).iteritems():
-            self._touched_test_names.add(test_name)
+            self._touched_tests.setdefault(test_name, set()).update(set(suffixes))
             _log.info("    %s (%s)" % (test_name, ','.join(suffixes)))
             # FIXME: we should use executive.run_in_parallel() to speed this up.
             self._run_webkit_patch(['rebaseline-test', '--suffixes', ','.join(suffixes), builder_name, test_name])
 
     def execute(self, options, args, tool):
-        self._touched_test_names = set([])
+        self._touched_tests = {}
         for port_name in tool.port_factory.all_port_names():
             self._rebaseline_port(port_name)
         for port_name in tool.port_factory.all_port_names():
             self._update_expectations_file(port_name)
         if not options.optimize:
             return
-        for test_name in self._touched_test_names:
-            _log.info("Optimizing baselines for %s." % test_name)
-            self._run_webkit_patch(['optimize-baselines', test_name])
+        for test_name, suffixes in self._touched_tests.iteritems():
+            _log.info("Optimizing baselines for %s (%s)." % (test_name, ','.join(suffixes)))
+            self._run_webkit_patch(['optimize-baselines', '--suffixes', ','.join(suffixes), test_name])
 
 
 class Rebaseline(AbstractDeclarativeCommand):

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py (120453 => 120454)


--- trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py	2012-06-15 14:17:29 UTC (rev 120453)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py	2012-06-15 14:22:13 UTC (rev 120454)
@@ -237,11 +237,11 @@
         OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=False), [], tool], expected_logs=expected_logs, expected_stderr=expected_stderr)
 
         expected_logs_with_optimize = expected_logs + (
-            "Optimizing baselines for userscripts/another-test.html.\n"
-            "Optimizing baselines for userscripts/images.svg.\n")
+            "Optimizing baselines for userscripts/another-test.html (txt).\n"
+            "Optimizing baselines for userscripts/images.svg (png).\n")
         expected_stderr_with_optimize = expected_stderr + (
-            "MOCK run_command: ['echo', 'optimize-baselines', 'userscripts/another-test.html'], cwd=/mock-checkout\n"
-            "MOCK run_command: ['echo', 'optimize-baselines', 'userscripts/images.svg'], cwd=/mock-checkout\n")
+            "MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'userscripts/another-test.html'], cwd=/mock-checkout\n"
+            "MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'png', 'userscripts/images.svg'], cwd=/mock-checkout\n")
 
         command._tests_to_rebaseline = lambda port: {'userscripts/another-test.html': set(['txt']), 'userscripts/images.svg': set(['png'])}
         OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True), [], tool], expected_logs=expected_logs_with_optimize, expected_stderr=expected_stderr_with_optimize)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to