Changeset 69737 in webkit
- Timestamp:
- Oct 13, 2010 10:04:43 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r69736 r69737 1 2010-10-13 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Make --port a global option and pass the port information to the commit-queue subprocess 6 https://bugs.webkit.org/show_bug.cgi?id=47650 7 8 This patch paves the way to run the commit-queue on a non-Mac port. 9 10 * Scripts/webkitpy/tool/commands/queues.py: 11 * Scripts/webkitpy/tool/commands/queues_unittest.py: 12 * Scripts/webkitpy/tool/commands/queuestest.py: 13 * Scripts/webkitpy/tool/main.py: 14 * Scripts/webkitpy/tool/steps/options.py: 15 * Scripts/webkitpy/tool/steps/preparechangelog.py: 16 * Scripts/webkitpy/tool/steps/runtests.py: 17 * Scripts/webkitpy/tool/steps/update.py: 18 1 19 2010-10-13 Adam Barth <abarth@webkit.org> 2 20 -
trunk/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
r68673 r69737 81 81 if self._tool.status_server.bot_id: 82 82 webkit_patch_args += ["--bot-id=%s" % self._tool.status_server.bot_id] 83 if self._options.port: 84 webkit_patch_args += ["--port=%s" % self._options.port] 83 85 webkit_patch_args.extend(args) 84 86 return self._tool.executive.run_and_throw_if_fail(webkit_patch_args) … … 97 99 def begin_work_queue(self): 98 100 log("CAUTION: %s will discard all local changes in \"%s\"" % (self.name, self._tool.scm().checkout_root)) 99 if self. options.confirm:101 if self._options.confirm: 100 102 response = self._tool.user.prompt("Are you sure? Type \"yes\" to continue: ") 101 103 if (response != "yes"): … … 109 111 def should_continue_work_queue(self): 110 112 self._iteration_count += 1 111 return not self. options.iterations or self._iteration_count <= self.options.iterations113 return not self._options.iterations or self._iteration_count <= self._options.iterations 112 114 113 115 def next_work_item(self): … … 126 128 127 129 def execute(self, options, args, tool, engine=QueueEngine): 128 self. options = options# FIXME: This code is wrong. Command.options is a list, this assumes an Options element!130 self._options = options # FIXME: This code is wrong. Command.options is a list, this assumes an Options element! 129 131 self._tool = tool # FIXME: This code is wrong too! Command.bind_to_tool handles this! 130 132 return engine(self.name, self, self._tool.wakeup_event).run() -
trunk/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
r69685 r69737 61 61 self.assertEquals(TestQueue()._log_directory(), "test-queue-logs") 62 62 63 def _assert_run_webkit_patch(self, run_args ):63 def _assert_run_webkit_patch(self, run_args, port=None): 64 64 queue = TestQueue() 65 65 tool = MockTool() … … 67 67 tool.executive = Mock() 68 68 queue.bind_to_tool(tool) 69 queue._options = Mock() 70 queue._options.port = port 69 71 70 72 queue.run_webkit_patch(run_args) 71 expected_run_args = ["echo", "--status-host=example.com", "--bot-id=gort"] + run_args 73 expected_run_args = ["echo", "--status-host=example.com", "--bot-id=gort"] 74 if port: 75 expected_run_args.append("--port=%s" % port) 76 expected_run_args.extend(run_args) 72 77 tool.executive.run_and_throw_if_fail.assert_called_with(expected_run_args) 73 78 … … 75 80 self._assert_run_webkit_patch([1]) 76 81 self._assert_run_webkit_patch(["one", 2]) 82 self._assert_run_webkit_patch([1], port="mockport") 77 83 78 84 def test_iteration_count(self): 79 85 queue = TestQueue() 80 queue. options = Mock()81 queue. options.iterations = 386 queue._options = Mock() 87 queue._options.iterations = 3 82 88 self.assertTrue(queue.should_continue_work_queue()) 83 89 self.assertTrue(queue.should_continue_work_queue()) … … 87 93 def test_no_iteration_count(self): 88 94 queue = TestQueue() 89 queue. options = Mock()95 queue._options = Mock() 90 96 self.assertTrue(queue.should_continue_work_queue()) 91 97 self.assertTrue(queue.should_continue_work_queue()) … … 141 147 tool = MockTool() 142 148 queue.bind_to_tool(tool) 149 queue._options = Mock() 150 queue._options.port = None 143 151 self.assertEquals(queue._fetch_next_work_item(), None) 144 152 tool.status_server = MockStatusServer(work_items=[2, 1, 3]) … … 151 159 tool = MockTool() 152 160 queue.bind_to_tool(tool) 161 queue._options = Mock() 162 queue._options.port = None 153 163 self.assertEquals(queue.collection_name(), "test-review-queue") 154 164 self.assertEquals(queue.fetch_potential_patch_ids(), [103]) … … 292 302 queue = SecondThoughtsCommitQueue() 293 303 queue.bind_to_tool(MockTool()) 304 queue._options = Mock() 305 queue._options.port = None 294 306 expected_stderr = """MOCK: update_status: commit-queue Applied patch 295 307 MOCK: update_status: commit-queue Built patch -
trunk/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
r67913 r69737 81 81 return "CAUTION: %(name)s will discard all local changes in \"%(checkout_dir)s\"\nRunning WebKit %(name)s.\nMOCK: update_status: %(name)s Starting Queue\n" % string_replacements 82 82 83 def assert_queue_outputs(self, queue, args=None, work_item=None, expected_stdout=None, expected_stderr=None, expected_exceptions=None, options=Mock(), tool=MockTool()): 83 def assert_queue_outputs(self, queue, args=None, work_item=None, expected_stdout=None, expected_stderr=None, expected_exceptions=None, options=None, tool=None): 84 if not tool: 85 tool = MockTool() 84 86 if not expected_stdout: 85 87 expected_stdout = {} … … 88 90 if not args: 89 91 args = [] 92 if not options: 93 options = Mock() 94 options.port = None 90 95 if not work_item: 91 96 work_item = self.mock_work_item -
trunk/WebKitTools/Scripts/webkitpy/tool/main.py
r68673 r69737 63 63 make_option("--bot-id", action="store", dest="bot_id", type="string", help="Identifier for this bot (if multiple bots are running for a queue)"), 64 64 make_option("--irc-password", action="store", dest="irc_password", type="string", help="Password to use when communicating via IRC."), 65 make_option("--port", action="store", dest="port", default=None, help="Specify a port (e.g., mac, qt, gtk, ...)."), 65 66 ] 66 67 -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/options.py
r67896 r69737 51 51 open_bug = make_option("--open-bug", action="store_true", dest="open_bug", default=False, help="Opens the associated bug in a browser.") 52 52 parent_command = make_option("--parent-command", action="store", dest="parent_command", default=None, help="(Internal) The command that spawned this instance.") 53 port = make_option("--port", action="store", dest="port", default=None, help="Specify a port (e.g., mac, qt, gtk, ...).")54 53 quiet = make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output.") 55 54 request_commit = make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review.") -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py
r68496 r69737 40 40 def options(cls): 41 41 return AbstractStep.options() + [ 42 Options.port,43 42 Options.quiet, 44 43 Options.email, -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
r66053 r69737 38 38 Options.non_interactive, 39 39 Options.quiet, 40 Options.port,41 40 ] 42 41 -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/update.py
r58328 r69737 37 37 return AbstractStep.options() + [ 38 38 Options.update, 39 Options.port,40 39 ] 41 40
Note: See TracChangeset
for help on using the changeset viewer.