- Revision
- 110944
- Author
- [email protected]
- Date
- 2012-03-15 21:20:07 -0700 (Thu, 15 Mar 2012)
Log Message
The commit-queue should fast-track patches that have already passed the testing EWS bots
https://bugs.webkit.org/show_bug.cgi?id=81305
Reviewed by Eric Seidel.
If a patch has already passed the testing EWS bots (currently only the
chromium-ews bot), we should be able to land the patch without running
the tests again. This patch is somewhat risky in that the tests might
have been broken between when the EWS bots ran and when the
commit-queue is processing the patch. If that turns out to be a
problem in practice, we'll tighten up this fast-track in some way,
likely by making sure that the pass status is recent.
* Scripts/webkitpy/tool/bot/commitqueuetask.py:
(CommitQueueTaskDelegate.did_pass_testing_ews):
(CommitQueueTask._did_pass_tests_recently):
(CommitQueueTask.run):
* Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
(MockCommitQueue.did_pass_testing_ews):
(test_fast_success_case):
* Scripts/webkitpy/tool/commands/queues.py:
(CommitQueue.did_pass_testing_ews):
* Scripts/webkitpy/tool/commands/queues_unittest.py:
(test_did_pass_testing_ews):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (110943 => 110944)
--- trunk/Tools/ChangeLog 2012-03-16 04:19:05 UTC (rev 110943)
+++ trunk/Tools/ChangeLog 2012-03-16 04:20:07 UTC (rev 110944)
@@ -1,3 +1,30 @@
+2012-03-15 Adam Barth <[email protected]>
+
+ The commit-queue should fast-track patches that have already passed the testing EWS bots
+ https://bugs.webkit.org/show_bug.cgi?id=81305
+
+ Reviewed by Eric Seidel.
+
+ If a patch has already passed the testing EWS bots (currently only the
+ chromium-ews bot), we should be able to land the patch without running
+ the tests again. This patch is somewhat risky in that the tests might
+ have been broken between when the EWS bots ran and when the
+ commit-queue is processing the patch. If that turns out to be a
+ problem in practice, we'll tighten up this fast-track in some way,
+ likely by making sure that the pass status is recent.
+
+ * Scripts/webkitpy/tool/bot/commitqueuetask.py:
+ (CommitQueueTaskDelegate.did_pass_testing_ews):
+ (CommitQueueTask._did_pass_tests_recently):
+ (CommitQueueTask.run):
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
+ (MockCommitQueue.did_pass_testing_ews):
+ (test_fast_success_case):
+ * Scripts/webkitpy/tool/commands/queues.py:
+ (CommitQueue.did_pass_testing_ews):
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ (test_did_pass_testing_ews):
+
2012-03-15 Kentaro Hara <[email protected]>
[PerformanceTests] run-perf-tests should output correct units
Modified: trunk/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py (110943 => 110944)
--- trunk/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py 2012-03-16 04:19:05 UTC (rev 110943)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py 2012-03-16 04:20:07 UTC (rev 110944)
@@ -33,7 +33,10 @@
def parent_command(self):
return "commit-queue"
+ def did_pass_testing_ews(self, patch):
+ raise NotImplementedError("subclasses must implement")
+
class CommitQueueTask(PatchAnalysisTask):
def validate(self):
# Bugs might get closed, or patches might be obsoleted or r-'d while the
@@ -58,6 +61,11 @@
"ChangeLog validated",
"ChangeLog did not pass validation")
+ def _did_pass_tests_recently(self):
+ if self._delegate.did_pass_testing_ews(self._patch):
+ return True
+ return self._test_patch()
+
def run(self):
if not self.validate():
return False
@@ -74,7 +82,7 @@
if not self._build_without_patch():
return False
return self.report_failure()
- if not self._test_patch():
+ if not self._did_pass_tests_recently():
return False
# Make sure the patch is still valid before landing (e.g., make sure
# no one has set commit-queue- since we started working on the patch.)
Modified: trunk/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py (110943 => 110944)
--- trunk/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py 2012-03-16 04:19:05 UTC (rev 110943)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py 2012-03-16 04:20:07 UTC (rev 110944)
@@ -84,7 +84,10 @@
def build_style(self):
return "both"
+ def did_pass_testing_ews(self, patch):
+ return False
+
class FailingTestCommitQueue(MockCommitQueue):
def __init__(self, error_plan, test_failure_plan):
MockCommitQueue.__init__(self, error_plan)
@@ -144,6 +147,24 @@
"""
self._run_through_task(commit_queue, expected_stderr)
+ def test_fast_success_case(self):
+ commit_queue = MockCommitQueue([])
+ commit_queue.did_pass_testing_ews = lambda patch: True
+ expected_stderr = """run_webkit_patch: ['clean']
+command_passed: success_message='Cleaned working directory' patch='10000'
+run_webkit_patch: ['update']
+command_passed: success_message='Updated working directory' patch='10000'
+run_webkit_patch: ['apply-attachment', '--no-update', '--non-interactive', 10000]
+command_passed: success_message='Applied patch' patch='10000'
+run_webkit_patch: ['validate-changelog', '--non-interactive', 10000]
+command_passed: success_message='ChangeLog validated' patch='10000'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
+command_passed: success_message='Built patch' patch='10000'
+run_webkit_patch: ['land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 10000]
+command_passed: success_message='Landed patch' patch='10000'
+"""
+ self._run_through_task(commit_queue, expected_stderr)
+
def test_clean_failure(self):
commit_queue = MockCommitQueue([
ScriptError("MOCK clean failure"),
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queues.py (110943 => 110944)
--- trunk/Tools/Scripts/webkitpy/tool/commands/queues.py 2012-03-16 04:19:05 UTC (rev 110943)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queues.py 2012-03-16 04:20:07 UTC (rev 110944)
@@ -333,6 +333,12 @@
reporter = FlakyTestReporter(self._tool, self.name)
reporter.report_flaky_tests(patch, flaky_test_results, results_archive)
+ def did_pass_testing_ews(self, patch):
+ # Currently, chromium-ews is the only testing EWS. Once there are more,
+ # should make sure they all pass.
+ status = self._tool.status_server.patch_status("chromium-ews", patch.id())
+ return status == self._pass_status
+
# StepSequenceErrorHandler methods
def handle_script_error(cls, tool, state, script_error):
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py (110943 => 110944)
--- trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py 2012-03-16 04:19:05 UTC (rev 110943)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py 2012-03-16 04:20:07 UTC (rev 110944)
@@ -436,7 +436,13 @@
OutputCapture().assert_outputs(self, queue.report_flaky_tests, [QueuesTest.mock_work_item, test_results, MockZipFile()], expected_stderr=expected_stderr)
+ def test_did_pass_testing_ews(self):
+ tool = MockTool()
+ patch = tool.bugs.fetch_attachment(10000)
+ queue = TestCommitQueue(tool)
+ self.assertFalse(queue.did_pass_testing_ews(patch))
+
class StyleQueueTest(QueuesTest):
def test_style_queue_with_style_exception(self):
expected_stderr = {