WebKitTools/ChangeLog

 12010-09-22 Adam Barth <abarth@webkit.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 commit-queue should log more detailed messages to the QueueStatusServer
 6 https://bugs.webkit.org/show_bug.cgi?id=46333
 7
 8 When I created CommitQueueTask, I removed most of the previous logging.
 9 This patch adds back more detailed logging so folks can see their patch
 10 progress through the queue.
 11
 12 * Scripts/webkitpy/tool/bot/commitqueuetask.py:
 13 * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
 14 * Scripts/webkitpy/tool/commands/queues.py:
 15 * Scripts/webkitpy/tool/commands/queues_unittest.py:
 16
1172010-09-22 Mihai Parparita <mihaip@chromium.org>
218
319 Reviewed by Darin Fisher.
68115

WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py

@@class CommitQueueTask(object):
5050 # the ChangeLog check during landing.
5151 return True
5252
53  def _run_command(self, command, failure_message):
 53 def _run_command(self, command, success_message, failure_message):
5454 try:
5555 self._commit_queue.run_webkit_patch(command)
 56 self._commit_queue.command_passed(success_message, patch=self._patch)
5657 return True
5758 except ScriptError, e:
5859 self._script_error = e

@@class CommitQueueTask(object):
6667 "--non-interactive",
6768 "--quiet",
6869 self._patch.id(),
69  ], "Patch does not apply")
 70 ],
 71 "Applied path",
 72 "Patch does not apply")
7073
7174 def _build(self):
7275 return self._run_command([

@@class CommitQueueTask(object):
7679 "--build",
7780 "--build-style=both",
7881 "--quiet",
79  ], "Patch does not build")
 82 ],
 83 "Built patch",
 84 "Patch does not build")
8085
8186 def _build_without_patch(self):
8287 return self._run_command([

@@class CommitQueueTask(object):
8691 "--build",
8792 "--build-style=both",
8893 "--quiet",
89  ], "Unable to build without patch")
 94 ],
 95 "Able to build without patch",
 96 "Unable to build without patch")
9097
9198 def _test(self):
9299 return self._run_command([

@@class CommitQueueTask(object):
97104 "--test",
98105 "--quiet",
99106 "--non-interactive",
100  ], "Patch does not pass tests")
 107 ],
 108 "Passed tests",
 109 "Patch does not pass tests")
101110
102111 def _build_and_test_without_patch(self):
103112 return self._run_command([

@@class CommitQueueTask(object):
108117 "--test",
109118 "--quiet",
110119 "--non-interactive",
111  ], "Unable to pass tests without patch")
 120 ],
 121 "Able to pass tests without patch",
 122 "Unable to pass tests without patch")
112123
113124 def _land(self):
114125 return self._run_command([

@@class CommitQueueTask(object):
119130 "--non-interactive",
120131 "--parent-command=commit-queue",
121132 self._patch.id(),
122  ], "Unable to land patch")
 133 ],
 134 "Landed patch",
 135 "Unable to land patch")
123136
124137 def run(self):
125138 if not self._validate():
68114

WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py

@@class MockCommitQueue:
4747 if error:
4848 raise error
4949
 50 def command_passed(self, success_message, patch):
 51 log("command_passed: success_message='%s' patch='%s'" % (
 52 success_message, patch.id()))
 53
5054 def command_failed(self, failure_message, script_error, patch):
5155 log("command_failed: failure_message='%s' script_error='%s' patch='%s'" % (
5256 failure_message, script_error, patch.id()))

@@class CommitQueueTaskTest(unittest.TestC
6367 def test_success_case(self):
6468 commit_queue = MockCommitQueue([])
6569 expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
 70command_passed: success_message='Applied path' patch='197'
6671run_webkit_patch: ['build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
 72command_passed: success_message='Built patch' patch='197'
6773run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
 74command_passed: success_message='Passed tests' patch='197'
6875run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--quiet', '--non-interactive', '--parent-command=commit-queue', 197]
 76command_passed: success_message='Landed patch' patch='197'
6977"""
7078 self._run_through_task(commit_queue, expected_stderr)
7179

@@command_failed: failure_message='Patch d
8492 ScriptError("MOCK build failure"),
8593 ])
8694 expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
 95command_passed: success_message='Applied path' patch='197'
8796run_webkit_patch: ['build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
8897command_failed: failure_message='Patch does not build' script_error='MOCK build failure' patch='197'
8998run_webkit_patch: ['build', '--force-clean', '--no-update', '--build', '--build-style=both', '--quiet']
 99command_passed: success_message='Able to build without patch' patch='197'
90100"""
91101 self._run_through_task(commit_queue, expected_stderr, ScriptError)
92102

@@run_webkit_patch: ['build', '--force-cle
97107 ScriptError("MOCK clean build failure"),
98108 ])
99109 expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
 110command_passed: success_message='Applied path' patch='197'
100111run_webkit_patch: ['build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
101112command_failed: failure_message='Patch does not build' script_error='MOCK build failure' patch='197'
102113run_webkit_patch: ['build', '--force-clean', '--no-update', '--build', '--build-style=both', '--quiet']

@@command_failed: failure_message='Unable
111122 ScriptError("MOCK tests failure"),
112123 ])
113124 expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
 125command_passed: success_message='Applied path' patch='197'
114126run_webkit_patch: ['build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
 127command_passed: success_message='Built patch' patch='197'
115128run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
116129command_failed: failure_message='Patch does not pass tests' script_error='MOCK tests failure' patch='197'
117130run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
 131command_passed: success_message='Passed tests' patch='197'
118132run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--quiet', '--non-interactive', '--parent-command=commit-queue', 197]
 133command_passed: success_message='Landed patch' patch='197'
119134"""
120135 self._run_through_task(commit_queue, expected_stderr)
121136

@@run_webkit_patch: ['land-attachment', '-
127142 ScriptError("MOCK test failure again"),
128143 ])
129144 expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
 145command_passed: success_message='Applied path' patch='197'
130146run_webkit_patch: ['build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
 147command_passed: success_message='Built patch' patch='197'
131148run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
132149command_failed: failure_message='Patch does not pass tests' script_error='MOCK test failure' patch='197'
133150run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
134151command_failed: failure_message='Patch does not pass tests' script_error='MOCK test failure again' patch='197'
135152run_webkit_patch: ['build-and-test', '--force-clean', '--no-update', '--build', '--test', '--quiet', '--non-interactive']
 153command_passed: success_message='Able to pass tests without patch' patch='197'
136154"""
137155 self._run_through_task(commit_queue, expected_stderr, ScriptError)
138156

@@run_webkit_patch: ['build-and-test', '--
145163 ScriptError("MOCK clean test failure"),
146164 ])
147165 expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
 166command_passed: success_message='Applied path' patch='197'
148167run_webkit_patch: ['build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
 168command_passed: success_message='Built patch' patch='197'
149169run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
150170command_failed: failure_message='Patch does not pass tests' script_error='MOCK test failure' patch='197'
151171run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
68114

WebKitTools/Scripts/webkitpy/tool/commands/queues.py

@@class CommitQueue(AbstractPatchQueue, St
243243 def handle_unexpected_error(self, patch, message):
244244 self.committer_validator.reject_patch_from_commit_queue(patch.id(), message)
245245
 246 def command_passed(self, message, patch):
 247 self._update_status(message, patch=patch)
 248
246249 def command_failed(message, script_error, patch):
247250 failure_log = self._log_from_script_error_for_upload(script_error)
248251 return self._update_status(message, patch=patch, results_file=failure_log)
68114

WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py

@@class CommitQueueTest(QueuesTest):
196196 "begin_work_queue": self._default_begin_work_queue_stderr("commit-queue", MockSCM.fake_checkout_root),
197197 "should_proceed_with_work_item": "MOCK: update_status: commit-queue Landing patch\n",
198198 "next_work_item": "",
199  "process_work_item": "MOCK: update_status: commit-queue Pass\n",
 199 "process_work_item": """MOCK: update_status: commit-queue Applied path
 200MOCK: update_status: commit-queue Built patch
 201MOCK: update_status: commit-queue Passed tests
 202MOCK: update_status: commit-queue Landed patch
 203MOCK: update_status: commit-queue Pass
 204""",
200205 "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'Mock error message'\n",
201206 "handle_script_error": "ScriptError error message\n",
202207 }

@@class CommitQueueTest(QueuesTest):
210215 "should_proceed_with_work_item": "MOCK: update_status: commit-queue Landing patch\n",
211216 "next_work_item": "",
212217 "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
 218MOCK: update_status: commit-queue Applied path
213219MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
 220MOCK: update_status: commit-queue Built patch
214221MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
 222MOCK: update_status: commit-queue Passed tests
215223MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--ignore-builders', '--quiet', '--non-interactive', '--parent-command=commit-queue', 197]
 224MOCK: update_status: commit-queue Landed patch
216225MOCK: update_status: commit-queue Pass
217226""",
218227 "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'Mock error message'\n",

@@MOCK: update_status: commit-queue Pass
229238 "should_proceed_with_work_item": "MOCK: update_status: commit-queue Landing rollout patch\n",
230239 "next_work_item": "",
231240 "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--force-clean', '--non-interactive', '--quiet', 197]
 241MOCK: update_status: commit-queue Applied path
232242MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--no-clean', '--no-update', '--build', '--build-style=both', '--quiet']
 243MOCK: update_status: commit-queue Built patch
233244MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build-and-test', '--no-clean', '--no-update', '--test', '--quiet', '--non-interactive']
 245MOCK: update_status: commit-queue Passed tests
234246MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--ignore-builders', '--quiet', '--non-interactive', '--parent-command=commit-queue', 197]
 247MOCK: update_status: commit-queue Landed patch
235248MOCK: update_status: commit-queue Pass
236249""",
237250 "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'Mock error message'\n",

@@MOCK: update_status: commit-queue Pass
257270 def test_manual_reject_during_processing(self):
258271 queue = SecondThoughtsCommitQueue()
259272 queue.bind_to_tool(MockTool())
260  queue.process_work_item(MockPatch())
 273 expected_stderr = """MOCK: update_status: commit-queue Applied path
 274MOCK: update_status: commit-queue Built patch
 275MOCK: update_status: commit-queue Passed tests
 276MOCK: update_status: commit-queue Landed patch
 277MOCK: update_status: commit-queue Pass
 278"""
 279 OutputCapture().assert_outputs(self, queue.process_work_item, [MockPatch()], expected_stderr=expected_stderr)
261280
262281
263282class RietveldUploadQueueTest(QueuesTest):
68114