Title: [122534] trunk/Tools
Revision
122534
Author
aba...@webkit.org
Date
2012-07-12 18:26:53 -0700 (Thu, 12 Jul 2012)

Log Message

CommitQueue is confused about what port it is using
https://bugs.webkit.org/show_bug.cgi?id=91040

Reviewed by Dirk Pranke.

On EC2, we explicitly pass --port to the commit-queue, but that
requires editing the start-queue.sh script locally on each bot. In
moving to Google Compute Engine, we're try to avoid any local edits to
the EWSTools.

Rather than passing --port to the commit-queue, this patch teaches the
CommitQueue which port its running, which is the approach we use for
the EWS bots.

Mutating tool._deprecated_port is a bit ugly, but it's what we're doing
currently for the EWS bots.

* Scripts/webkitpy/tool/commands/queues.py:
(CommitQueue):
(CommitQueue.begin_work_queue):
(CommitQueue.run_command):
* Scripts/webkitpy/tool/commands/queues_unittest.py:
(CommitQueueTest.test_commit_queue):
(mock_run_webkit_patch):
(test_rollout):
(test_rollout_lands):
(test_manual_reject_during_processing):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (122533 => 122534)


--- trunk/Tools/ChangeLog	2012-07-13 00:34:26 UTC (rev 122533)
+++ trunk/Tools/ChangeLog	2012-07-13 01:26:53 UTC (rev 122534)
@@ -1,3 +1,33 @@
+2012-07-12  Adam Barth  <aba...@webkit.org>
+
+        CommitQueue is confused about what port it is using
+        https://bugs.webkit.org/show_bug.cgi?id=91040
+
+        Reviewed by Dirk Pranke.
+
+        On EC2, we explicitly pass --port to the commit-queue, but that
+        requires editing the start-queue.sh script locally on each bot. In
+        moving to Google Compute Engine, we're try to avoid any local edits to
+        the EWSTools.
+
+        Rather than passing --port to the commit-queue, this patch teaches the
+        CommitQueue which port its running, which is the approach we use for
+        the EWS bots.
+
+        Mutating tool._deprecated_port is a bit ugly, but it's what we're doing
+        currently for the EWS bots.
+
+        * Scripts/webkitpy/tool/commands/queues.py:
+        (CommitQueue):
+        (CommitQueue.begin_work_queue):
+        (CommitQueue.run_command):
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        (CommitQueueTest.test_commit_queue):
+        (mock_run_webkit_patch):
+        (test_rollout):
+        (test_rollout_lands):
+        (test_manual_reject_during_processing):
+
 2012-07-12  James Simonsen  <simon...@chromium.org>
 
         [Navigation Timing] Import the W3C Navigation Timing test suite

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queues.py (122533 => 122534)


--- trunk/Tools/Scripts/webkitpy/tool/commands/queues.py	2012-07-13 00:34:26 UTC (rev 122533)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queues.py	2012-07-13 01:26:53 UTC (rev 122534)
@@ -38,6 +38,7 @@
 from StringIO import StringIO
 
 from webkitpy.common.config.committervalidator import CommitterValidator
+from webkitpy.common.config.ports import DeprecatedPort
 from webkitpy.common.net.bugzilla import Attachment
 from webkitpy.common.net.statusserver import StatusServer
 from webkitpy.common.system.deprecated_logging import error, log
@@ -257,10 +258,16 @@
 
 class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler, CommitQueueTaskDelegate):
     name = "commit-queue"
+    port_name = "chromium-xvfb"
 
     # AbstractPatchQueue methods
 
     def begin_work_queue(self):
+        if not self._options.port:
+            self.port = DeprecatedPort.port(self.port_name)
+            # FIXME: This violates abstraction
+            self._tool._deprecated_port = self.port
+
         AbstractPatchQueue.begin_work_queue(self)
         self.committer_validator = CommitterValidator(self._tool)
         self._expected_failures = ExpectedFailures()
@@ -305,7 +312,7 @@
     # CommitQueueTaskDelegate methods
 
     def run_command(self, command):
-        self.run_webkit_patch(command)
+        self.run_webkit_patch(command + [self.port.flag()])
 
     def command_passed(self, message, patch):
         self._update_status(message, patch=patch)

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py (122533 => 122534)


--- trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py	2012-07-13 00:34:26 UTC (rev 122533)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py	2012-07-13 01:26:53 UTC (rev 122534)
@@ -49,7 +49,7 @@
         CommitQueue.__init__(self)
         if tool:
             self.bind_to_tool(tool)
-        self._options = MockOptions(confirm=False, parent_command="commit-queue")
+        self._options = MockOptions(confirm=False, parent_command="commit-queue", port=None)
 
     def begin_work_queue(self):
         output_capture = OutputCapture()
@@ -231,8 +231,8 @@
 
     def test_commit_queue(self):
         tool = MockTool()
-        tool.filesystem.write_text_file('/mock-results/full_results.json', '')  # Otherwise the commit-queue will hit a KeyError trying to read the results from the MockFileSystem.
-        tool.filesystem.write_text_file('/mock-results/webkit_unit_tests_output.xml', '')
+        tool.filesystem.write_text_file('/tmp/layout-test-results/full_results.json', '')  # Otherwise the commit-queue will hit a KeyError trying to read the results from the MockFileSystem.
+        tool.filesystem.write_text_file('/tmp/layout-test-results/webkit_unit_tests_output.xml', '')
         expected_stderr = {
             "begin_work_queue": self._default_begin_work_queue_stderr("commit-queue"),
             "next_work_item": "",
@@ -269,7 +269,7 @@
         queue = CommitQueue()
 
         def mock_run_webkit_patch(command):
-            if command == ['clean'] or command == ['update']:
+            if command[0] == 'clean' or command[0] == 'update':
                 # We want cleaning to succeed so we can error out on a step
                 # that causes the commit-queue to reject the patch.
                 return
@@ -298,7 +298,7 @@
         queue = CommitQueue()
 
         def mock_run_webkit_patch(command):
-            if command == ['clean'] or command == ['update']:
+            if command[0] == 'clean' or command[0] == 'update':
                 # We want cleaning to succeed so we can error out on a step
                 # that causes the commit-queue to reject the patch.
                 return
@@ -310,29 +310,29 @@
 
     def test_rollout(self):
         tool = MockTool(log_executive=True)
-        tool.filesystem.write_text_file('/mock-results/full_results.json', '')  # Otherwise the commit-queue will hit a KeyError trying to read the results from the MockFileSystem.
-        tool.filesystem.write_text_file('/mock-results/webkit_unit_tests_output.xml', '')
+        tool.filesystem.write_text_file('/tmp/layout-test-results/full_results.json', '')  # Otherwise the commit-queue will hit a KeyError trying to read the results from the MockFileSystem.
+        tool.filesystem.write_text_file('/tmp/layout-test-results/webkit_unit_tests_output.xml', '')
         tool.buildbot.light_tree_on_fire()
         expected_stderr = {
             "begin_work_queue": self._default_begin_work_queue_stderr("commit-queue"),
             "next_work_item": "",
-            "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'clean'], cwd=/mock-checkout
+            "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'clean', '--port=%(port_name)s'], cwd=/mock-checkout
 MOCK: update_status: commit-queue Cleaned working directory
-MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'update'], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'update', '--port=%(port_name)s'], cwd=/mock-checkout
 MOCK: update_status: commit-queue Updated working directory
-MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--no-update', '--non-interactive', 10000], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--no-update', '--non-interactive', 10000, '--port=%(port_name)s'], cwd=/mock-checkout
 MOCK: update_status: commit-queue Applied patch
-MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'validate-changelog', '--non-interactive', 10000], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'validate-changelog', '--non-interactive', 10000, '--port=%(port_name)s'], cwd=/mock-checkout
 MOCK: update_status: commit-queue ChangeLog validated
-MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--no-clean', '--no-update', '--build-style=both'], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--no-clean', '--no-update', '--build-style=both', '--port=%(port_name)s'], cwd=/mock-checkout
 MOCK: update_status: commit-queue Built patch
-MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive'], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive', '--port=%(port_name)s'], cwd=/mock-checkout
 MOCK: update_status: commit-queue Passed tests
-MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 10000], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 10000, '--port=%(port_name)s'], cwd=/mock-checkout
 MOCK: update_status: commit-queue Landed patch
 MOCK: update_status: commit-queue Pass
 MOCK: release_work_item: commit-queue 10000
-""",
+""" % {"port_name": CommitQueue.port_name},
             "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.' and additional comment 'Mock error message'\n",
             "handle_script_error": "ScriptError error message\n\nMOCK output\n",
         }
@@ -346,19 +346,19 @@
         expected_stderr = {
             "begin_work_queue": self._default_begin_work_queue_stderr("commit-queue"),
             "next_work_item": "",
-            "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'clean'], cwd=/mock-checkout
+            "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'clean', '--port=%(port_name)s'], cwd=/mock-checkout
 MOCK: update_status: commit-queue Cleaned working directory
-MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'update'], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'update', '--port=%(port_name)s'], cwd=/mock-checkout
 MOCK: update_status: commit-queue Updated working directory
-MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--no-update', '--non-interactive', 10005], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--no-update', '--non-interactive', 10005, '--port=%(port_name)s'], cwd=/mock-checkout
 MOCK: update_status: commit-queue Applied patch
-MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'validate-changelog', '--non-interactive', 10005], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'validate-changelog', '--non-interactive', 10005, '--port=%(port_name)s'], cwd=/mock-checkout
 MOCK: update_status: commit-queue ChangeLog validated
-MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 10005], cwd=/mock-checkout
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 10005, '--port=%(port_name)s'], cwd=/mock-checkout
 MOCK: update_status: commit-queue Landed patch
 MOCK: update_status: commit-queue Pass
 MOCK: release_work_item: commit-queue 10005
-""",
+""" % {"port_name": CommitQueue.port_name},
             "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10005' with comment 'Rejecting attachment 10005 from commit-queue.' and additional comment 'Mock error message'\n",
             "handle_script_error": "ScriptError error message\n\nMOCK output\n",
         }
@@ -382,8 +382,8 @@
     def test_manual_reject_during_processing(self):
         queue = SecondThoughtsCommitQueue(MockTool())
         queue.begin_work_queue()
-        queue._tool.filesystem.write_text_file('/mock-results/full_results.json', '')  # Otherwise the commit-queue will hit a KeyError trying to read the results from the MockFileSystem.
-        queue._tool.filesystem.write_text_file('/mock-results/webkit_unit_tests_output.xml', '')
+        queue._tool.filesystem.write_text_file('/tmp/layout-test-results/full_results.json', '')  # Otherwise the commit-queue will hit a KeyError trying to read the results from the MockFileSystem.
+        queue._tool.filesystem.write_text_file('/tmp/layout-test-results/webkit_unit_tests_output.xml', '')
         queue._options = Mock()
         queue._options.port = None
         expected_stderr = """MOCK: update_status: commit-queue Cleaned working directory
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to