Changeset 57035 in webkit


Ignore:
Timestamp:
Apr 2, 2010 5:14:45 PM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-04-02 Adam Barth <abarth@webkit.org>

Reviewed by Darin Adler.

commit-queue should ignore builders when landing rollouts
https://bugs.webkit.org/show_bug.cgi?id=37051

When we moved the "builders are red" check into the master process, we
forgot about rollouts. I thought we had a test covering this case, but
looking at the test, it was a bit too loose. I added a new test and
introduced some new logging technology into MockTool to make the test
tighter.

  • Scripts/webkitpy/tool/commands/queues.py:
  • Scripts/webkitpy/tool/commands/queues_unittest.py:
  • Scripts/webkitpy/tool/mocktool.py:
Location:
trunk/WebKitTools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r57011 r57035  
     12010-04-02  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        commit-queue should ignore builders when landing rollouts
     6        https://bugs.webkit.org/show_bug.cgi?id=37051
     7
     8        When we moved the "builders are red" check into the master process, we
     9        forgot about rollouts.  I thought we had a test covering this case, but
     10        looking at the test, it was a bit too loose.  I added a new test and
     11        introduced some new logging technology into MockTool to make the test
     12        tighter.
     13
     14        * Scripts/webkitpy/tool/commands/queues.py:
     15        * Scripts/webkitpy/tool/commands/queues_unittest.py:
     16        * Scripts/webkitpy/tool/mocktool.py:
     17
    1182010-04-02  David Levin  <levin@chromium.org>
    219
  • trunk/WebKitTools/Scripts/webkitpy/tool/commands/queues.py

    r56986 r57035  
    206206    def _land(self, patch, first_run=False):
    207207        try:
    208             if not self._builders_are_green():
     208            # We need to check the builders, unless we're trying to land a
     209            # rollout (in which case the builders are probably red.)
     210            if not patch.is_rollout() and not self._builders_are_green():
    209211                # We return true here because we want to return to the main
    210212                # QueueEngine loop as quickly as possible.
     
    232234                # built and tested.
    233235                args.append("--no-update")
    234             if patch.is_rollout():
    235                 # We need to ignore the builders when landing a rollout
    236                 # because they're probably red.
    237                 args.append("--ignore-builders")
    238236            self.run_webkit_patch(args)
    239237            self._did_pass(patch)
  • trunk/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py

    r56519 r57035  
    4444class TestReviewQueue(AbstractReviewQueue):
    4545    name = "test-review-queue"
     46
     47
     48class MockPatch(object):
     49    def is_rollout(self):
     50        return True
     51
     52    def bug_id(self):
     53        return 12345
     54
     55    def id(self):
     56        return 76543
    4657
    4758
     
    113124
    114125    def test_rollout(self):
    115         tool = MockTool()
     126        tool = MockTool(log_executive=True)
    116127        tool.buildbot.light_tree_on_fire()
    117128        expected_stderr = {
     
    125136        self.assert_queue_outputs(CommitQueue(), tool=tool, expected_stderr=expected_stderr)
    126137
     138    def test_rollout_lands(self):
     139        tool = MockTool(log_executive=True)
     140        tool.buildbot.light_tree_on_fire()
     141        rollout_patch = MockPatch()
     142        expected_stderr = {
     143            "begin_work_queue": "CAUTION: commit-queue will discard all local changes in \"%s\"\nRunning WebKit commit-queue.\n" % MockSCM.fake_checkout_root,
     144            # FIXME: The commit-queue warns about bad committers twice.  This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
     145            "next_work_item": """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
     146Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
     1471 patch in commit-queue [106]
     148""",
     149            "process_work_item": "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--non-interactive', '--ignore-builders', '--build-style=both', '--quiet', '76543']\n",
     150        }
     151        self.assert_queue_outputs(CommitQueue(), tool=tool, work_item=rollout_patch, expected_stderr=expected_stderr)
     152
    127153
    128154class StyleQueueTest(QueuesTest):
  • trunk/WebKitTools/Scripts/webkitpy/tool/mocktool.py

    r56863 r57035  
    446446class MockTool():
    447447
    448     def __init__(self):
     448    def __init__(self, log_executive=False):
    449449        self.wakeup_event = threading.Event()
    450450        self.bugs = MockBugzilla()
    451451        self.buildbot = MockBuildBot()
    452452        self.executive = Mock()
     453        if log_executive:
     454            self.executive.run_and_throw_if_fail = lambda args: log("MOCK run_and_throw_if_fail: %s" % args)
    453455        self._irc = None
    454456        self.user = MockUser()
Note: See TracChangeset for help on using the changeset viewer.