Title: [122258] trunk/Tools
Revision
122258
Author
[email protected]
Date
2012-07-10 13:54:21 -0700 (Tue, 10 Jul 2012)

Log Message

webkit-patch rebaseline doesn't work for audio/pixel tests
https://bugs.webkit.org/show_bug.cgi?id=90905

Reviewed by Adam Barth.

We just need to pass the correct suffix list to rebaseline-test-internal
and optimize-baselines. By default, pass all suffixes.

* Scripts/webkitpy/tool/commands/rebaseline.py:
(Rebaseline):
(Rebaseline.__init__):
(Rebaseline._suffixes_to_update):
(Rebaseline.execute):
* Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
(test_rebaseline_multiple_builders_and_tests_command_line):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (122257 => 122258)


--- trunk/Tools/ChangeLog	2012-07-10 20:47:24 UTC (rev 122257)
+++ trunk/Tools/ChangeLog	2012-07-10 20:54:21 UTC (rev 122258)
@@ -1,3 +1,21 @@
+2012-07-10  Ojan Vafai  <[email protected]>
+
+        webkit-patch rebaseline doesn't work for audio/pixel tests
+        https://bugs.webkit.org/show_bug.cgi?id=90905
+
+        Reviewed by Adam Barth.
+
+        We just need to pass the correct suffix list to rebaseline-test-internal
+        and optimize-baselines. By default, pass all suffixes.
+
+        * Scripts/webkitpy/tool/commands/rebaseline.py:
+        (Rebaseline):
+        (Rebaseline.__init__):
+        (Rebaseline._suffixes_to_update):
+        (Rebaseline.execute):
+        * Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
+        (test_rebaseline_multiple_builders_and_tests_command_line):
+
 2012-07-10  Adam Barth  <[email protected]>
 
         Remove LayoutTestController and WebKitTestRunner support for Hixie76 WebSockets

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


--- trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py	2012-07-10 20:47:24 UTC (rev 122257)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py	2012-07-10 20:54:21 UTC (rev 122258)
@@ -365,12 +365,13 @@
 
 class Rebaseline(AbstractParallelRebaselineCommand):
     name = "rebaseline"
-    help_text = "Replaces local expected.txt files with new results from build bots. Shows the list of failing tests on the builders if no test names are provided."
+    help_text = "Rebaseline tests with results from the build bots. Shows the list of failing tests on the builders if no test names are provided."
     argument_names = "[TEST_NAMES]"
 
     def __init__(self):
         options = [
             optparse.make_option("--builders", default=None, action="" help="Comma-separated-list of builders to pull new baselines from (can also be provided multiple times)"),
+            optparse.make_option("--suffixes", default=BASELINE_SUFFIX_LIST, action="" help="Comma-separated-list of file types to rebaseline (can also be provided multiple times)"),
         ]
         AbstractParallelRebaselineCommand.__init__(self, options=options)
 
@@ -396,6 +397,12 @@
         failing_tests = builder.latest_layout_test_results().tests_matching_failure_types([test_failures.FailureTextMismatch])
         return self._tool.user.prompt_with_list("Which test(s) to rebaseline for %s:" % builder.name(), failing_tests, can_choose_multiple=True)
 
+    def _suffixes_to_update(self, options):
+        suffixes = []
+        for suffix_list in options.suffixes:
+            suffixes += suffix_list.split(",")
+        return suffixes
+
     def execute(self, options, args, tool):
         if options.builders:
             builders = []
@@ -411,8 +418,7 @@
             for test in tests:
                 if test not in test_list:
                     test_list[test] = {}
-                # FIXME: Allow for choosing the suffixes.
-                test_list[test][builder.name()] = ['txt']
+                test_list[test][builder.name()] = self._suffixes_to_update(options)
 
         if options.verbose:
             print "rebaseline-json: " + str(test_list)

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


--- trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py	2012-07-10 20:47:24 UTC (rev 122257)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py	2012-07-10 20:54:21 UTC (rev 122258)
@@ -367,7 +367,7 @@
 MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'mock/path/to/test.html'], cwd=/mock-checkout
 """
 
-            OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True, builders=None, verbose=True), [], tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
+            OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True, builders=None, suffixes=["txt"], verbose=True), [], tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
 
         finally:
             builders._exact_matches = old_exact_matches
@@ -399,7 +399,7 @@
 
             builder = "MOCK builder"
             test = "mock/path/to/test.html"
-            OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True, builders=[builder], verbose=True), [test], tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
+            OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True, builders=[builder], suffixes=["txt"], verbose=True), [test], tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
 
         finally:
             builders._exact_matches = old_exact_matches
@@ -440,7 +440,7 @@
 MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'mock/path/to/test.html'], cwd=/mock-checkout
 """
 
-            OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True, builders=None, verbose=True), [], tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
+            OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True, builders=None, suffixes=["txt"], verbose=True), [], tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
 
         finally:
             builders._exact_matches = old_exact_matches
@@ -465,18 +465,18 @@
 
             tool.executive = MockExecutive(should_log=True)
 
-            expected_stdout = """rebaseline-json: {'mock/path/to/test.html': {'MOCK builder2': ['txt'], 'MOCK builder': ['txt'], 'MOCK builder3': ['txt']}, 'mock/path/to/test2.html': {'MOCK builder2': ['txt'], 'MOCK builder': ['txt'], 'MOCK builder3': ['txt']}}
+            expected_stdout = """rebaseline-json: {'mock/path/to/test.html': {'MOCK builder2': ['txt', 'png', 'wav'], 'MOCK builder': ['txt', 'png', 'wav'], 'MOCK builder3': ['txt', 'png', 'wav']}, 'mock/path/to/test2.html': {'MOCK builder2': ['txt', 'png', 'wav'], 'MOCK builder': ['txt', 'png', 'wav'], 'MOCK builder3': ['txt', 'png', 'wav']}}
 """
 
-            expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK builder2', '--test', 'mock/path/to/test.html'], cwd=/mock-checkout
-MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK builder', '--test', 'mock/path/to/test.html'], cwd=/mock-checkout
-MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK builder2', '--test', 'mock/path/to/test2.html'], cwd=/mock-checkout
-MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK builder', '--test', 'mock/path/to/test2.html'], cwd=/mock-checkout
-MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'mock/path/to/test.html'], cwd=/mock-checkout
-MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'mock/path/to/test2.html'], cwd=/mock-checkout
+            expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png,wav', '--builder', 'MOCK builder2', '--test', 'mock/path/to/test.html'], cwd=/mock-checkout
+MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png,wav', '--builder', 'MOCK builder', '--test', 'mock/path/to/test.html'], cwd=/mock-checkout
+MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png,wav', '--builder', 'MOCK builder2', '--test', 'mock/path/to/test2.html'], cwd=/mock-checkout
+MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png,wav', '--builder', 'MOCK builder', '--test', 'mock/path/to/test2.html'], cwd=/mock-checkout
+MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'wav,txt,png', 'mock/path/to/test.html'], cwd=/mock-checkout
+MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'wav,txt,png', 'mock/path/to/test2.html'], cwd=/mock-checkout
 """
 
-            OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True, builders=["MOCK builder,MOCK builder2", "MOCK builder3"], verbose=True), ["mock/path/to/test.html", "mock/path/to/test2.html"], tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
+            OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True, builders=["MOCK builder,MOCK builder2", "MOCK builder3"], suffixes=["txt", "png,wav"], verbose=True), ["mock/path/to/test.html", "mock/path/to/test2.html"], tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
 
         finally:
             builders._exact_matches = old_exact_matches
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to