From: ojan@chromium.org Date: Tue, 3 Jul 2012 19:30:10 +0000 (+0000) Subject: Rename rebaseline-test to rebaseline-test-internal X-Git-Tag: 070512121124~98 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=329ecc16f7cccf52b70bcd5f8b31954add0d7a2c;p=profile%2Fivi%2Fwebkit-efl.git Rename rebaseline-test to rebaseline-test-internal https://bugs.webkit.org/show_bug.cgi?id=90485 Reviewed by Adam Barth. It's now only used by other rebaseline commands. It's still useful to leave it as it's own command to aid in debugging when something goes wrong. In a followup patch, I'll make webkit-patch rebaseline cover any use-cases that rebaseline-test might have covered. We no longer need the --print-scm-changes option since the only caller always passes that option in. Also, make all the arguments command-line flags instead. Simplifies the code a bit in my opinion. * Scripts/webkitpy/tool/commands/rebaseline.py: (RebaselineTest): (RebaselineTest.__init__): (RebaselineTest.execute): (AbstractParallelRebaselineCommand._rebaseline_commands): (RebaselineExpectations.execute): * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: (test_rebaseline_all): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121799 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Tools/ChangeLog b/Tools/ChangeLog index 3c801e5..f73b6f3 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,30 @@ +2012-07-03 Ojan Vafai + + Rename rebaseline-test to rebaseline-test-internal + https://bugs.webkit.org/show_bug.cgi?id=90485 + + Reviewed by Adam Barth. + + It's now only used by other rebaseline commands. It's still useful to leave it + as it's own command to aid in debugging when something goes wrong. In a followup + patch, I'll make webkit-patch rebaseline cover any use-cases that rebaseline-test + might have covered. + + We no longer need the --print-scm-changes option since the only caller always passes + that option in. + + Also, make all the arguments command-line flags instead. Simplifies the code + a bit in my opinion. + + * Scripts/webkitpy/tool/commands/rebaseline.py: + (RebaselineTest): + (RebaselineTest.__init__): + (RebaselineTest.execute): + (AbstractParallelRebaselineCommand._rebaseline_commands): + (RebaselineExpectations.execute): + * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: + (test_rebaseline_all): + 2012-07-03 Balazs Kelemen [Qt][WTR] Get rid of using DumpRenderTreeSupportQt diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py index 933334d..3542b9a 100644 --- a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py +++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py @@ -68,17 +68,17 @@ class AbstractRebaseliningCommand(AbstractDeclarativeCommand): class RebaselineTest(AbstractRebaseliningCommand): - name = "rebaseline-test" - help_text = "Rebaseline a single test from a buildbot. (Currently works only with build.chromium.org buildbots.)" - argument_names = "BUILDER_NAME TEST_NAME [PLATFORMS_TO_MOVE_EXISTING_BASELINES_TO]" + name = "rebaseline-test-internal" + help_text = "Rebaseline a single test from a buildbot. Only intended for use by other webkit-patch commands." def __init__(self): options = [ - optparse.make_option("--print-scm-changes", action="store_true", help="Print modifcations to the scm (as a json dict) rather than actually modifying the scm"), + optparse.make_option("--builder", help="Builder to pull new baselines from"), + optparse.make_option("--platform-to-move-to", help="Platform to move existing baselines to before rebaselining. This is for dealing with bringing up new ports that interact with non-tree portions of the fallback graph."), + optparse.make_option("--test", help="Test to rebaseline"), ] AbstractRebaseliningCommand.__init__(self, options=options) - self._print_scm_changes = False - self._scm_changes = {} + self._scm_changes = {'add': []} def _results_url(self, builder_name): port = self._tool.port_factory.get_from_builder_name(builder_name) @@ -135,10 +135,7 @@ class RebaselineTest(AbstractRebaseliningCommand): self._add_to_scm(target_baseline) def _add_to_scm(self, path): - if self._print_scm_changes: - self._scm_changes['add'].append(path) - else: - self._tool.scm().add(path) + self._scm_changes['add'].append(path) def _update_expectations_file(self, builder_name, test_name): port = self._tool.port_factory.get_from_builder_name(builder_name) @@ -179,16 +176,8 @@ class RebaselineTest(AbstractRebaseliningCommand): def execute(self, options, args, tool): self._baseline_suffix_list = options.suffixes.split(',') - self._print_scm_changes = options.print_scm_changes - self._scm_changes = {'add': [], 'delete': []} - - if len(args) > 2: - platforms_to_move_existing_baselines_to = args[2:] - else: - platforms_to_move_existing_baselines_to = None - self._rebaseline_test_and_update_expectations(args[0], args[1], platforms_to_move_existing_baselines_to) - if self._print_scm_changes: - print json.dumps(self._scm_changes) + self._rebaseline_test_and_update_expectations(options.builder, options.test, options.platform_to_move_to) + print json.dumps(self._scm_changes) class OptimizeBaselines(AbstractRebaseliningCommand): @@ -283,7 +272,7 @@ class AbstractParallelRebaselineCommand(AbstractDeclarativeCommand): for test in test_list: for builder in self._builders_to_fetch_from(test_list[test]): suffixes = ','.join(test_list[test][builder]) - cmd_line = [path_to_webkit_patch, 'rebaseline-test', '--print-scm-changes', '--suffixes', suffixes, builder, test] + cmd_line = [path_to_webkit_patch, 'rebaseline-test-internal', '--suffixes', suffixes, '--builder', builder, '--test', test] commands.append(tuple([cmd_line, cwd])) return commands @@ -371,8 +360,7 @@ class RebaselineExpectations(AbstractParallelRebaselineCommand): 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. +# FIXME: Make this use AbstractParallelRebaselineCommand. 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 bc40015..f7901a5 100644 --- a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py +++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py @@ -204,17 +204,17 @@ Retrieving http://example.com/f/builders/Webkit Mac10.7/results/layout-test-resu command.bind_to_tool(tool) tool.executive = MockExecutive(should_log=True) - expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt,png', 'MOCK builder', 'user-scripts/another-test.html'], cwd=/mock-checkout + expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder', '--test', '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, [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', 'txt,png', 'MOCK builder (Debug)', 'user-scripts/another-test.html'], cwd=/mock-checkout + expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder (Debug)', '--test', '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, [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', 'txt', 'MOCK builder', 'user-scripts/another-test.html'], cwd=/mock-checkout + expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK builder', '--test', '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, [options, {"user-scripts/another-test.html":{"MOCK builder (Debug)": ["txt", "png"], "MOCK builder": ["txt"]}}], expected_stderr=expected_stderr) @@ -281,7 +281,7 @@ Using the chromium port without having the downstream skia_test_expectations.txt Using the chromium port without having the downstream skia_test_expectations.txt file checked out. Expectations related things might be wonky. """ - 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_stdout = """[(['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Webkit Linux 32', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Webkit Linux', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Webkit Mac10.6', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Webkit Mac10.7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Webkit Win7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Webkit Win', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Qt Linux Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Webkit Linux 32', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Webkit Linux', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Webkit Mac10.6', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Webkit Mac10.7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Webkit Win7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Webkit Win', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Qt Linux Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout')] """ expected_stderr = """MOCK run_command: ['qmake', '-v'], cwd=None