From b2f7ff712f463dd80149d219a954582baefe88e3 Mon Sep 17 00:00:00 2001 From: "ojan@chromium.org" Date: Tue, 3 Jul 2012 03:36:05 +0000 Subject: [PATCH] webkit-patch rebaseline-expectations should share code with rebaseline-all https://bugs.webkit.org/show_bug.cgi?id=90413 Reviewed by Dirk Pranke. Make them share code. In addition to reducing code duplication this makes rebaseline-expectations considerably faster by rebaselining in parallel. * Scripts/webkitpy/tool/commands/rebaseline.py: (AbstractParallelRebaselineCommand): (AbstractParallelRebaselineCommand._run_webkit_patch): (AbstractParallelRebaselineCommand._rebaseline): (RebaselineJson): (RebaselineJson.execute): (RebaselineExpectations): (RebaselineExpectations._update_expectations_file): (RebaselineExpectations._tests_to_rebaseline): (RebaselineExpectations._add_tests_to_rebaseline_for_port): (RebaselineExpectations.execute): * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: (test_rebaseline_all): (test_rebaseline_expectations.run_in_parallel): (test_rebaseline_expectations): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121724 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Tools/ChangeLog | 26 +++++ Tools/Scripts/webkitpy/tool/commands/rebaseline.py | 122 ++++++++++----------- .../webkitpy/tool/commands/rebaseline_unittest.py | 76 ++++++------- .../webkitpy/tool/servers/gardeningserver.py | 2 +- .../tool/servers/gardeningserver_unittest.py | 2 +- 5 files changed, 123 insertions(+), 105 deletions(-) diff --git a/Tools/ChangeLog b/Tools/ChangeLog index e20e177..a66e617 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,29 @@ +2012-07-02 Ojan Vafai + + webkit-patch rebaseline-expectations should share code with rebaseline-all + https://bugs.webkit.org/show_bug.cgi?id=90413 + + Reviewed by Dirk Pranke. + + Make them share code. In addition to reducing code duplication this makes + rebaseline-expectations considerably faster by rebaselining in parallel. + + * Scripts/webkitpy/tool/commands/rebaseline.py: + (AbstractParallelRebaselineCommand): + (AbstractParallelRebaselineCommand._run_webkit_patch): + (AbstractParallelRebaselineCommand._rebaseline): + (RebaselineJson): + (RebaselineJson.execute): + (RebaselineExpectations): + (RebaselineExpectations._update_expectations_file): + (RebaselineExpectations._tests_to_rebaseline): + (RebaselineExpectations._add_tests_to_rebaseline_for_port): + (RebaselineExpectations.execute): + * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: + (test_rebaseline_all): + (test_rebaseline_expectations.run_in_parallel): + (test_rebaseline_expectations): + 2012-07-02 Xiaobo Wang [BlackBerry] Update DumpRenderTree to have it work interactively in parallel diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py index 34b4ece..933334d 100644 --- a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py +++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py @@ -239,10 +239,7 @@ class AnalyzeBaselines(AbstractRebaseliningCommand): self._analyze_baseline(test_name) -class RebaselineExpectations(AbstractDeclarativeCommand): - name = "rebaseline-expectations" - help_text = "Rebaselines the tests indicated in TestExpectations." - +class AbstractParallelRebaselineCommand(AbstractDeclarativeCommand): def __init__(self): options = [ optparse.make_option('--no-optimize', dest='optimize', action='store_false', default=True, @@ -258,60 +255,6 @@ class RebaselineExpectations(AbstractDeclarativeCommand): except ScriptError, e: _log.error(e) - def _update_expectations_file(self, port_name): - port = self._tool.port_factory.get(port_name) - - # FIXME: This will intentionally skip over any REBASELINE expectations that were in an overrides file. - # This is not good, but avoids having the overrides getting written into the main file. - # See https://bugs.webkit.org/show_bug.cgi?id=88456 for context. This will no longer be needed - # once we properly support cascading expectations files. - expectations = TestExpectations(port, include_overrides=False) - path = port.path_to_test_expectations_file() - self._tool.filesystem.write_text_file(path, expectations.remove_rebaselined_tests(expectations.get_rebaselining_failures())) - - def _tests_to_rebaseline(self, port): - tests_to_rebaseline = {} - expectations = TestExpectations(port, include_overrides=True) - for test in expectations.get_rebaselining_failures(): - tests_to_rebaseline[test] = suffixes_for_expectations(expectations.get_expectations(test)) - return tests_to_rebaseline - - def _rebaseline_port(self, port_name): - builder_name = builders.builder_name_for_port_name(port_name) - if not builder_name: - return - tests = self._tests_to_rebaseline(self._tool.port_factory.get(port_name)).items() - if tests: - _log.info("Retrieving results for %s from %s." % (port_name, builder_name)) - for test_name, suffixes in tests: - 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_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, 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 RebaselineAll(AbstractDeclarativeCommand): - name = "rebaseline-all" - help_text = "Rebaseline based off JSON passed to stdin. Intended to only be called from other scripts." - - def _run_webkit_patch(self, args): - try: - self._tool.executive.run_command([self._tool.path()] + args, cwd=self._tool.scm().checkout_root) - except ScriptError, e: - _log.error(e) - def _builders_to_fetch_from(self, builders): # This routine returns the subset of builders that will cover all of the baseline search paths # used in the input list. In particular, if the input list contains both Release and Debug @@ -362,21 +305,74 @@ class RebaselineAll(AbstractDeclarativeCommand): all_suffixes.update(test_list[test][builder]) self._run_webkit_patch(['optimize-baselines', '--suffixes', ','.join(all_suffixes), test]) - def _rebaseline(self, json_input): - test_list = json.loads(json_input) - + def _rebaseline(self, options, test_list): commands = self._rebaseline_commands(test_list) command_results = self._tool.executive.run_in_parallel(commands) files_to_add = self._files_to_add(command_results) self._tool.scm().add_list(list(files_to_add)) - self._optimize_baselines(test_list) + if options.optimize: + self._optimize_baselines(test_list) + + +class RebaselineJson(AbstractParallelRebaselineCommand): + name = "rebaseline-json" + help_text = "Rebaseline based off JSON passed to stdin. Intended to only be called from other scripts." + + def execute(self, options, args, tool): + self._rebaseline(options, json.loads(sys.stdin.read())) + + +class RebaselineExpectations(AbstractParallelRebaselineCommand): + name = "rebaseline-expectations" + help_text = "Rebaselines the tests indicated in TestExpectations." + + def _update_expectations_file(self, port_name): + port = self._tool.port_factory.get(port_name) + + # FIXME: This will intentionally skip over any REBASELINE expectations that were in an overrides file. + # This is not good, but avoids having the overrides getting written into the main file. + # See https://bugs.webkit.org/show_bug.cgi?id=88456 for context. This will no longer be needed + # once we properly support cascading expectations files. + expectations = TestExpectations(port, include_overrides=False) + path = port.path_to_test_expectations_file() + self._tool.filesystem.write_text_file(path, expectations.remove_rebaselined_tests(expectations.get_rebaselining_failures())) + + def _tests_to_rebaseline(self, port): + tests_to_rebaseline = {} + expectations = TestExpectations(port, include_overrides=True) + for test in expectations.get_rebaselining_failures(): + tests_to_rebaseline[test] = suffixes_for_expectations(expectations.get_expectations(test)) + return tests_to_rebaseline + + def _add_tests_to_rebaseline_for_port(self, port_name): + builder_name = builders.builder_name_for_port_name(port_name) + if not builder_name: + return + tests = self._tests_to_rebaseline(self._tool.port_factory.get(port_name)).items() + + if tests: + _log.info("Retrieving results for %s from %s." % (port_name, builder_name)) + + for test_name, suffixes in tests: + _log.info(" %s (%s)" % (test_name, ','.join(suffixes))) + if test_name not in self._test_list: + self._test_list[test_name] = {} + self._test_list[test_name][builder_name] = suffixes def execute(self, options, args, tool): - self._rebaseline(sys.stdin.read()) + self._test_list = {} + for port_name in tool.port_factory.all_port_names(): + self._add_tests_to_rebaseline_for_port(port_name) + self._rebaseline(options, self._test_list) + + for port_name in tool.port_factory.all_port_names(): + self._update_expectations_file(port_name) +# FIXME: Merge this with rebaseline-test. The only difference is that this prompts if you leave out the test-name, builder or suffixes. +# We should just make rebaseline-test prompt and get rid of this command. class Rebaseline(AbstractDeclarativeCommand): name = "rebaseline" help_text = "Replaces local expected.txt files with new results from build bots" diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py index 169e2a8..7a688dc 100644 --- a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py +++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py @@ -196,25 +196,27 @@ Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-resu "MOCK builder (Debug)": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier", "debug"])}, } - command = RebaselineAll() + command = RebaselineJson() tool = MockTool() + options = MockOptions() + options.optimize = True command.bind_to_tool(tool) tool.executive = MockExecutive(should_log=True) - expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', u'txt,png', u'MOCK builder', u'user-scripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', u'txt,png', u'user-scripts/another-test.html'], cwd=/mock-checkout + expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt,png', 'MOCK builder', 'user-scripts/another-test.html'], cwd=/mock-checkout +MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html'], cwd=/mock-checkout """ - OutputCapture().assert_outputs(self, command._rebaseline, ['{"user-scripts/another-test.html":{"MOCK builder": ["txt","png"]}}'], expected_stderr=expected_stderr) + OutputCapture().assert_outputs(self, command._rebaseline, [options, {"user-scripts/another-test.html":{"MOCK builder": ["txt", "png"]}}], expected_stderr=expected_stderr) - expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', u'txt,png', u'MOCK builder (Debug)', u'user-scripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', u'txt,png', u'user-scripts/another-test.html'], cwd=/mock-checkout + expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt,png', 'MOCK builder (Debug)', 'user-scripts/another-test.html'], cwd=/mock-checkout +MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html'], cwd=/mock-checkout """ - OutputCapture().assert_outputs(self, command._rebaseline, ['{"user-scripts/another-test.html":{"MOCK builder (Debug)": ["txt","png"]}}'], expected_stderr=expected_stderr) + OutputCapture().assert_outputs(self, command._rebaseline, [options, {"user-scripts/another-test.html":{"MOCK builder (Debug)": ["txt", "png"]}}], expected_stderr=expected_stderr) - expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', u'txt', u'MOCK builder', u'user-scripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', u'txt', u'user-scripts/another-test.html'], cwd=/mock-checkout + expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt', 'MOCK builder', 'user-scripts/another-test.html'], cwd=/mock-checkout +MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'user-scripts/another-test.html'], cwd=/mock-checkout """ - OutputCapture().assert_outputs(self, command._rebaseline, ['{"user-scripts/another-test.html":{"MOCK builder (Debug)": ["txt","png"], "MOCK builder": ["txt"]}}'], expected_stderr=expected_stderr) + OutputCapture().assert_outputs(self, command._rebaseline, [options, {"user-scripts/another-test.html":{"MOCK builder (Debug)": ["txt", "png"], "MOCK builder": ["txt"]}}], expected_stderr=expected_stderr) builders._exact_matches = old_exact_matches @@ -231,6 +233,12 @@ MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', u'txt', u'user-sc # Don't enable logging until after we create the mock expectation files as some Port.__init__'s run subcommands. tool.executive = MockExecutive(should_log=True) + def run_in_parallel(commands): + print commands + return "" + + tool.executive.run_in_parallel = run_in_parallel + expected_logs = """Retrieving results for chromium-linux-x86 from Webkit Linux 32. userscripts/another-test.html (txt) userscripts/images.svg (png) @@ -266,28 +274,11 @@ Retrieving results for win-7sp0 from Apple Win 7 Release (Tests). userscripts/images.svg (png) """ - expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Webkit Linux 32', 'userscripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'Webkit Linux 32', 'userscripts/images.svg'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Webkit Linux', 'userscripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'Webkit Linux', 'userscripts/images.svg'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Webkit Mac10.7', 'userscripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'Webkit Mac10.7', 'userscripts/images.svg'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Webkit Mac10.6', 'userscripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'Webkit Mac10.6', 'userscripts/images.svg'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Webkit Win7', 'userscripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'Webkit Win7', 'userscripts/images.svg'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Webkit Win', 'userscripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'Webkit Win', 'userscripts/images.svg'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'EFL Linux 64-bit Release', 'userscripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'EFL Linux 64-bit Release', 'userscripts/images.svg'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'GTK Linux 64-bit Release', 'userscripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'GTK Linux 64-bit Release', 'userscripts/images.svg'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Apple Lion Release WK1 (Tests)', 'userscripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'Apple Lion Release WK1 (Tests)', 'userscripts/images.svg'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Qt Linux Release', 'userscripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'Qt Linux Release', 'userscripts/images.svg'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt', 'Apple Win 7 Release (Tests)', 'userscripts/another-test.html'], cwd=/mock-checkout -MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'png', 'Apple Win 7 Release (Tests)', 'userscripts/images.svg'], cwd=/mock-checkout + expected_stdout = """[(['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt', 'Webkit Linux 32', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt', 'Webkit Linux', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt', 'Webkit Mac10.6', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt', 'Webkit Mac10.7', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt', 'Webkit Win7', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt', 'Apple Win 7 Release (Tests)', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt', 'EFL Linux 64-bit Release', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt', 'Webkit Win', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt', 'GTK Linux 64-bit Release', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt', 'Qt Linux Release', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt', 'Apple Lion Release WK1 (Tests)', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'png', 'Webkit Linux 32', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'png', 'Webkit Linux', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'png', 'Webkit Mac10.6', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'png', 'Webkit Mac10.7', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'png', 'Webkit Win7', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'png', 'Apple Win 7 Release (Tests)', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'png', 'EFL Linux 64-bit Release', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'png', 'Webkit Win', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'png', 'GTK Linux 64-bit Release', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'png', 'Qt Linux Release', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'png', 'Apple Lion Release WK1 (Tests)', 'userscripts/images.svg'], '/mock-checkout')] +""" + + expected_stderr = """MOCK run_command: ['qmake', '-v'], cwd=None +MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None @@ -295,17 +286,22 @@ MOCK run_command: ['qmake', '-v'], cwd=None """ 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=False), [], tool], expected_logs=expected_logs, expected_stderr=expected_stderr) + OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=False), [], tool], expected_logs=expected_logs, expected_stdout=expected_stdout, expected_stderr=expected_stderr) - expected_logs_with_optimize = expected_logs + ( - "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', '--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") + expected_stderr_with_optimize = """MOCK run_command: ['qmake', '-v'], cwd=None +MOCK run_command: ['qmake', '-v'], cwd=None +MOCK run_command: ['qmake', '-v'], cwd=None +MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'userscripts/another-test.html'], cwd=/mock-checkout +MOCK run_command: ['qmake', '-v'], cwd=None +MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'png', 'userscripts/images.svg'], cwd=/mock-checkout +MOCK run_command: ['qmake', '-v'], cwd=None +MOCK run_command: ['qmake', '-v'], cwd=None +MOCK run_command: ['qmake', '-v'], cwd=None +MOCK run_command: ['qmake', '-v'], cwd=None +""" 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) + OutputCapture().assert_outputs(self, command.execute, [MockOptions(optimize=True), [], tool], expected_logs=expected_logs, expected_stdout=expected_stdout, expected_stderr=expected_stderr_with_optimize) def test_overrides_are_included_correctly(self): command = RebaselineExpectations() diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py index c83d65f..947bf1d 100644 --- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py +++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py @@ -141,6 +141,6 @@ class GardeningHTTPRequestHandler(ReflectionHandler): self._serve_text('success') def rebaselineall(self): - command = ['rebaseline-all'] + command = ['rebaseline-json'] self.server.tool.executive.run_command([self.server.tool.path()] + command, input=self.read_entity_body(), cwd=self.server.tool.scm().checkout_root) self._serve_text('success') diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py index c738a0d..1ba068c 100644 --- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py +++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py @@ -183,7 +183,7 @@ class GardeningServerTest(unittest.TestCase): self._post_to_path("/rollout?revision=2314&reason=MOCK+rollout+reason", expected_stderr=expected_stderr, expected_stdout=expected_stdout) def test_rebaselineall(self): - expected_stderr = "MOCK run_command: ['echo', 'rebaseline-all'], cwd=/mock-checkout, input={\"user-scripts/another-test.html\":{\"%s\": [%s]}}\n" + expected_stderr = "MOCK run_command: ['echo', 'rebaseline-json'], cwd=/mock-checkout, input={\"user-scripts/another-test.html\":{\"%s\": [%s]}}\n" expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" server = MockServer() -- 2.7.4