Changeset 121799 in webkit


Ignore:
Timestamp:
Jul 3, 2012 12:30:10 PM (12 years ago)
Author:
ojan@chromium.org
Message:

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):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r121788 r121799  
     12012-07-03  Ojan Vafai  <ojan@chromium.org>
     2
     3        Rename rebaseline-test to rebaseline-test-internal
     4        https://bugs.webkit.org/show_bug.cgi?id=90485
     5
     6        Reviewed by Adam Barth.
     7
     8        It's now only used by other rebaseline commands. It's still useful to leave it
     9        as it's own command to aid in debugging when something goes wrong. In a followup
     10        patch, I'll make webkit-patch rebaseline cover any use-cases that rebaseline-test
     11        might have covered.
     12
     13        We no longer need the --print-scm-changes option since the only caller always passes
     14        that option in.
     15
     16        Also, make all the arguments command-line flags instead. Simplifies the code
     17        a bit in my opinion.
     18
     19        * Scripts/webkitpy/tool/commands/rebaseline.py:
     20        (RebaselineTest):
     21        (RebaselineTest.__init__):
     22        (RebaselineTest.execute):
     23        (AbstractParallelRebaselineCommand._rebaseline_commands):
     24        (RebaselineExpectations.execute):
     25        * Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
     26        (test_rebaseline_all):
     27
    1282012-07-03  Balazs Kelemen  <kbalazs@webkit.org>
    229
  • trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py

    r121724 r121799  
    6969
    7070class RebaselineTest(AbstractRebaseliningCommand):
    71     name = "rebaseline-test"
    72     help_text = "Rebaseline a single test from a buildbot.  (Currently works only with build.chromium.org buildbots.)"
    73     argument_names = "BUILDER_NAME TEST_NAME [PLATFORMS_TO_MOVE_EXISTING_BASELINES_TO]"
     71    name = "rebaseline-test-internal"
     72    help_text = "Rebaseline a single test from a buildbot. Only intended for use by other webkit-patch commands."
    7473
    7574    def __init__(self):
    7675        options = [
    77             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"),
     76            optparse.make_option("--builder", help="Builder to pull new baselines from"),
     77            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."),
     78            optparse.make_option("--test", help="Test to rebaseline"),
    7879        ]
    7980        AbstractRebaseliningCommand.__init__(self, options=options)
    80         self._print_scm_changes = False
    81         self._scm_changes = {}
     81        self._scm_changes = {'add': []}
    8282
    8383    def _results_url(self, builder_name):
     
    136136
    137137    def _add_to_scm(self, path):
    138         if self._print_scm_changes:
    139             self._scm_changes['add'].append(path)
    140         else:
    141             self._tool.scm().add(path)
     138        self._scm_changes['add'].append(path)
    142139
    143140    def _update_expectations_file(self, builder_name, test_name):
     
    180177    def execute(self, options, args, tool):
    181178        self._baseline_suffix_list = options.suffixes.split(',')
    182         self._print_scm_changes = options.print_scm_changes
    183         self._scm_changes = {'add': [], 'delete': []}
    184 
    185         if len(args) > 2:
    186             platforms_to_move_existing_baselines_to = args[2:]
    187         else:
    188             platforms_to_move_existing_baselines_to = None
    189         self._rebaseline_test_and_update_expectations(args[0], args[1], platforms_to_move_existing_baselines_to)
    190         if self._print_scm_changes:
    191             print json.dumps(self._scm_changes)
     179        self._rebaseline_test_and_update_expectations(options.builder, options.test, options.platform_to_move_to)
     180        print json.dumps(self._scm_changes)
    192181
    193182
     
    284273            for builder in self._builders_to_fetch_from(test_list[test]):
    285274                suffixes = ','.join(test_list[test][builder])
    286                 cmd_line = [path_to_webkit_patch, 'rebaseline-test', '--print-scm-changes', '--suffixes', suffixes, builder, test]
     275                cmd_line = [path_to_webkit_patch, 'rebaseline-test-internal', '--suffixes', suffixes, '--builder', builder, '--test', test]
    287276                commands.append(tuple([cmd_line, cwd]))
    288277        return commands
     
    372361
    373362
    374 # FIXME: Merge this with rebaseline-test. The only difference is that this prompts if you leave out the test-name, builder or suffixes.
    375 # We should just make rebaseline-test prompt and get rid of this command.
     363# FIXME: Make this use AbstractParallelRebaselineCommand.
    376364class Rebaseline(AbstractDeclarativeCommand):
    377365    name = "rebaseline"
  • trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py

    r121784 r121799  
    205205        tool.executive = MockExecutive(should_log=True)
    206206
    207         expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt,png', 'MOCK builder', 'user-scripts/another-test.html'], cwd=/mock-checkout
     207        expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder', '--test', 'user-scripts/another-test.html'], cwd=/mock-checkout
    208208MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html'], cwd=/mock-checkout
    209209"""
    210210        OutputCapture().assert_outputs(self, command._rebaseline, [options, {"user-scripts/another-test.html":{"MOCK builder": ["txt", "png"]}}], expected_stderr=expected_stderr)
    211211
    212         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
     212        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
    213213MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html'], cwd=/mock-checkout
    214214"""
    215215        OutputCapture().assert_outputs(self, command._rebaseline, [options, {"user-scripts/another-test.html":{"MOCK builder (Debug)": ["txt", "png"]}}], expected_stderr=expected_stderr)
    216216
    217         expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test', '--print-scm-changes', '--suffixes', 'txt', 'MOCK builder', 'user-scripts/another-test.html'], cwd=/mock-checkout
     217        expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'MOCK builder', '--test', 'user-scripts/another-test.html'], cwd=/mock-checkout
    218218MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'user-scripts/another-test.html'], cwd=/mock-checkout
    219219"""
     
    282282"""
    283283
    284         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')]
     284        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')]
    285285"""
    286286
Note: See TracChangeset for help on using the changeset viewer.