Changeset 74403 in webkit


Ignore:
Timestamp:
Dec 20, 2010 11:48:11 PM (13 years ago)
Author:
eric@webkit.org
Message:

2010-12-20 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

commit-queue wrongly rejects patches when it can't update itself
https://bugs.webkit.org/show_bug.cgi?id=46636

  • Scripts/webkitpy/tool/bot/commitqueuetask.py:
  • Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
  • Scripts/webkitpy/tool/commands/queues_unittest.py:
Location:
trunk/Tools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r74396 r74403  
     12010-12-20  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        commit-queue wrongly rejects patches when it can't update itself
     6        https://bugs.webkit.org/show_bug.cgi?id=46636
     7
     8        * Scripts/webkitpy/tool/bot/commitqueuetask.py:
     9        * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
     10        * Scripts/webkitpy/tool/commands/queues_unittest.py:
     11
    1122010-12-20  Adam Barth  <abarth@webkit.org>
    213
  • trunk/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py

    r73682 r74403  
    8888        "Unable to clean working directory")
    8989
     90    def _update(self):
     91        # FIXME: Ideally the status server log message should include which revision we updated to.
     92        return self._run_command([
     93            "update",
     94        ],
     95        "Updated working directory",
     96        "Unable to update working directory")
     97
    9098    def _apply(self):
    9199        return self._run_command([
    92100            "apply-attachment",
     101            "--no-update",
    93102            "--non-interactive",
    94103            self._patch.id(),
     
    187196            return False
    188197        if not self._clean():
     198            return False
     199        if not self._update():
    189200            return False
    190201        if not self._apply():
  • trunk/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py

    r73682 r74403  
    7878        expected_stderr = """run_webkit_patch: ['clean']
    7979command_passed: success_message='Cleaned working directory' patch='197'
    80 run_webkit_patch: ['apply-attachment', '--non-interactive', 197]
     80run_webkit_patch: ['update']
     81command_passed: success_message='Updated working directory' patch='197'
     82run_webkit_patch: ['apply-attachment', '--no-update', '--non-interactive', 197]
    8183command_passed: success_message='Applied patch' patch='197'
    8284run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
     
    98100        self._run_through_task(commit_queue, expected_stderr)
    99101
     102    def test_update_failure(self):
     103        commit_queue = MockCommitQueue([
     104            None,
     105            ScriptError("MOCK update failure"),
     106        ])
     107        expected_stderr = """run_webkit_patch: ['clean']
     108command_passed: success_message='Cleaned working directory' patch='197'
     109run_webkit_patch: ['update']
     110command_failed: failure_message='Unable to update working directory' script_error='MOCK update failure' patch='197'
     111"""
     112        self._run_through_task(commit_queue, expected_stderr)
     113
    100114    def test_apply_failure(self):
    101115        commit_queue = MockCommitQueue([
    102116            None,
     117            None,
    103118            ScriptError("MOCK apply failure"),
    104119        ])
    105120        expected_stderr = """run_webkit_patch: ['clean']
    106121command_passed: success_message='Cleaned working directory' patch='197'
    107 run_webkit_patch: ['apply-attachment', '--non-interactive', 197]
     122run_webkit_patch: ['update']
     123command_passed: success_message='Updated working directory' patch='197'
     124run_webkit_patch: ['apply-attachment', '--no-update', '--non-interactive', 197]
    108125command_failed: failure_message='Patch does not apply' script_error='MOCK apply failure' patch='197'
    109126"""
     
    114131            None,
    115132            None,
     133            None,
    116134            ScriptError("MOCK build failure"),
    117135        ])
    118136        expected_stderr = """run_webkit_patch: ['clean']
    119137command_passed: success_message='Cleaned working directory' patch='197'
    120 run_webkit_patch: ['apply-attachment', '--non-interactive', 197]
     138run_webkit_patch: ['update']
     139command_passed: success_message='Updated working directory' patch='197'
     140run_webkit_patch: ['apply-attachment', '--no-update', '--non-interactive', 197]
    121141command_passed: success_message='Applied patch' patch='197'
    122142run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
     
    131151            None,
    132152            None,
     153            None,
    133154            ScriptError("MOCK build failure"),
    134155            ScriptError("MOCK clean build failure"),
     
    136157        expected_stderr = """run_webkit_patch: ['clean']
    137158command_passed: success_message='Cleaned working directory' patch='197'
    138 run_webkit_patch: ['apply-attachment', '--non-interactive', 197]
     159run_webkit_patch: ['update']
     160command_passed: success_message='Updated working directory' patch='197'
     161run_webkit_patch: ['apply-attachment', '--no-update', '--non-interactive', 197]
    139162command_passed: success_message='Applied patch' patch='197'
    140163run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
     
    150173            None,
    151174            None,
     175            None,
    152176            ScriptError("MOCK tests failure"),
    153177        ])
    154178        expected_stderr = """run_webkit_patch: ['clean']
    155179command_passed: success_message='Cleaned working directory' patch='197'
    156 run_webkit_patch: ['apply-attachment', '--non-interactive', 197]
     180run_webkit_patch: ['update']
     181command_passed: success_message='Updated working directory' patch='197'
     182run_webkit_patch: ['apply-attachment', '--no-update', '--non-interactive', 197]
    157183command_passed: success_message='Applied patch' patch='197'
    158184run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
     
    173199            None,
    174200            None,
     201            None,
    175202            ScriptError("MOCK test failure"),
    176203            ScriptError("MOCK test failure again"),
     
    178205        expected_stderr = """run_webkit_patch: ['clean']
    179206command_passed: success_message='Cleaned working directory' patch='197'
    180 run_webkit_patch: ['apply-attachment', '--non-interactive', 197]
     207run_webkit_patch: ['update']
     208command_passed: success_message='Updated working directory' patch='197'
     209run_webkit_patch: ['apply-attachment', '--no-update', '--non-interactive', 197]
    181210command_passed: success_message='Applied patch' patch='197'
    182211run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
     
    196225            None,
    197226            None,
     227            None,
    198228            ScriptError("MOCK test failure"),
    199229            ScriptError("MOCK test failure again"),
     
    202232        expected_stderr = """run_webkit_patch: ['clean']
    203233command_passed: success_message='Cleaned working directory' patch='197'
    204 run_webkit_patch: ['apply-attachment', '--non-interactive', 197]
     234run_webkit_patch: ['update']
     235command_passed: success_message='Updated working directory' patch='197'
     236run_webkit_patch: ['apply-attachment', '--no-update', '--non-interactive', 197]
    205237command_passed: success_message='Applied patch' patch='197'
    206238run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
     
    221253            None,
    222254            None,
     255            None,
    223256            ScriptError("MOCK land failure"),
    224257        ])
    225258        expected_stderr = """run_webkit_patch: ['clean']
    226259command_passed: success_message='Cleaned working directory' patch='197'
    227 run_webkit_patch: ['apply-attachment', '--non-interactive', 197]
     260run_webkit_patch: ['update']
     261command_passed: success_message='Updated working directory' patch='197'
     262run_webkit_patch: ['apply-attachment', '--no-update', '--non-interactive', 197]
    228263command_passed: success_message='Applied patch' patch='197'
    229264run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
  • trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py

    r74301 r74403  
    205205            "next_work_item": "",
    206206            "process_work_item": """MOCK: update_status: commit-queue Cleaned working directory
     207MOCK: update_status: commit-queue Updated working directory
    207208MOCK: update_status: commit-queue Applied patch
    208209MOCK: update_status: commit-queue Built patch
     
    223224            "next_work_item": "",
    224225            "process_work_item": """MOCK: update_status: commit-queue Cleaned working directory
     226MOCK: update_status: commit-queue Updated working directory
    225227MOCK: update_status: commit-queue Patch does not apply
    226228MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting attachment 197 from commit-queue.' and additional comment 'MOCK script error'
     
    234236
    235237        def mock_run_webkit_patch(command):
    236             if command == ['clean']:
     238            if command == ['clean'] or command == ['update']:
    237239                # We want cleaning to succeed so we can error out on a step
    238240                # that causes the commit-queue to reject the patch.
     
    252254            "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'clean']
    253255MOCK: update_status: commit-queue Cleaned working directory
    254 MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--non-interactive', 197]
     256MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'update']
     257MOCK: update_status: commit-queue Updated working directory
     258MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--no-update', '--non-interactive', 197]
    255259MOCK: update_status: commit-queue Applied patch
    256260MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--no-clean', '--no-update', '--build-style=both']
     
    279283            "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'clean']
    280284MOCK: update_status: commit-queue Cleaned working directory
    281 MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--non-interactive', 106]
     285MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'update']
     286MOCK: update_status: commit-queue Updated working directory
     287MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--no-update', '--non-interactive', 106]
    282288MOCK: update_status: commit-queue Applied patch
    283289MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--no-clean', '--no-update', '--build-style=both']
     
    314320        queue._options.port = None
    315321        expected_stderr = """MOCK: update_status: commit-queue Cleaned working directory
     322MOCK: update_status: commit-queue Updated working directory
    316323MOCK: update_status: commit-queue Applied patch
    317324MOCK: update_status: commit-queue Built patch
Note: See TracChangeset for help on using the changeset viewer.