Changeset 69737 in webkit


Ignore:
Timestamp:
Oct 13, 2010 10:04:43 PM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-10-13 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Make --port a global option and pass the port information to the commit-queue subprocess
https://bugs.webkit.org/show_bug.cgi?id=47650

This patch paves the way to run the commit-queue on a non-Mac port.

  • Scripts/webkitpy/tool/commands/queues.py:
  • Scripts/webkitpy/tool/commands/queues_unittest.py:
  • Scripts/webkitpy/tool/commands/queuestest.py:
  • Scripts/webkitpy/tool/main.py:
  • Scripts/webkitpy/tool/steps/options.py:
  • Scripts/webkitpy/tool/steps/preparechangelog.py:
  • Scripts/webkitpy/tool/steps/runtests.py:
  • Scripts/webkitpy/tool/steps/update.py:
Location:
trunk/WebKitTools
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r69736 r69737  
     12010-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
    1192010-10-13  Adam Barth  <abarth@webkit.org>
    220
  • trunk/WebKitTools/Scripts/webkitpy/tool/commands/queues.py

    r68673 r69737  
    8181        if self._tool.status_server.bot_id:
    8282            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]
    8385        webkit_patch_args.extend(args)
    8486        return self._tool.executive.run_and_throw_if_fail(webkit_patch_args)
     
    9799    def begin_work_queue(self):
    98100        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:
    100102            response = self._tool.user.prompt("Are you sure?  Type \"yes\" to continue: ")
    101103            if (response != "yes"):
     
    109111    def should_continue_work_queue(self):
    110112        self._iteration_count += 1
    111         return not self.options.iterations or self._iteration_count <= self.options.iterations
     113        return not self._options.iterations or self._iteration_count <= self._options.iterations
    112114
    113115    def next_work_item(self):
     
    126128
    127129    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!
    129131        self._tool = tool  # FIXME: This code is wrong too!  Command.bind_to_tool handles this!
    130132        return engine(self.name, self, self._tool.wakeup_event).run()
  • trunk/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py

    r69685 r69737  
    6161        self.assertEquals(TestQueue()._log_directory(), "test-queue-logs")
    6262
    63     def _assert_run_webkit_patch(self, run_args):
     63    def _assert_run_webkit_patch(self, run_args, port=None):
    6464        queue = TestQueue()
    6565        tool = MockTool()
     
    6767        tool.executive = Mock()
    6868        queue.bind_to_tool(tool)
     69        queue._options = Mock()
     70        queue._options.port = port
    6971
    7072        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)
    7277        tool.executive.run_and_throw_if_fail.assert_called_with(expected_run_args)
    7378
     
    7580        self._assert_run_webkit_patch([1])
    7681        self._assert_run_webkit_patch(["one", 2])
     82        self._assert_run_webkit_patch([1], port="mockport")
    7783
    7884    def test_iteration_count(self):
    7985        queue = TestQueue()
    80         queue.options = Mock()
    81         queue.options.iterations = 3
     86        queue._options = Mock()
     87        queue._options.iterations = 3
    8288        self.assertTrue(queue.should_continue_work_queue())
    8389        self.assertTrue(queue.should_continue_work_queue())
     
    8793    def test_no_iteration_count(self):
    8894        queue = TestQueue()
    89         queue.options = Mock()
     95        queue._options = Mock()
    9096        self.assertTrue(queue.should_continue_work_queue())
    9197        self.assertTrue(queue.should_continue_work_queue())
     
    141147        tool = MockTool()
    142148        queue.bind_to_tool(tool)
     149        queue._options = Mock()
     150        queue._options.port = None
    143151        self.assertEquals(queue._fetch_next_work_item(), None)
    144152        tool.status_server = MockStatusServer(work_items=[2, 1, 3])
     
    151159        tool = MockTool()
    152160        queue.bind_to_tool(tool)
     161        queue._options = Mock()
     162        queue._options.port = None
    153163        self.assertEquals(queue.collection_name(), "test-review-queue")
    154164        self.assertEquals(queue.fetch_potential_patch_ids(), [103])
     
    292302        queue = SecondThoughtsCommitQueue()
    293303        queue.bind_to_tool(MockTool())
     304        queue._options = Mock()
     305        queue._options.port = None
    294306        expected_stderr = """MOCK: update_status: commit-queue Applied patch
    295307MOCK: update_status: commit-queue Built patch
  • trunk/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py

    r67913 r69737  
    8181        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
    8282
    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()
    8486        if not expected_stdout:
    8587            expected_stdout = {}
     
    8890        if not args:
    8991            args = []
     92        if not options:
     93            options = Mock()
     94            options.port = None
    9095        if not work_item:
    9196            work_item = self.mock_work_item
  • trunk/WebKitTools/Scripts/webkitpy/tool/main.py

    r68673 r69737  
    6363        make_option("--bot-id", action="store", dest="bot_id", type="string", help="Identifier for this bot (if multiple bots are running for a queue)"),
    6464        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, ...)."),
    6566    ]
    6667
  • trunk/WebKitTools/Scripts/webkitpy/tool/steps/options.py

    r67896 r69737  
    5151    open_bug = make_option("--open-bug", action="store_true", dest="open_bug", default=False, help="Opens the associated bug in a browser.")
    5252    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, ...).")
    5453    quiet = make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output.")
    5554    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  
    4040    def options(cls):
    4141        return AbstractStep.options() + [
    42             Options.port,
    4342            Options.quiet,
    4443            Options.email,
  • trunk/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py

    r66053 r69737  
    3838            Options.non_interactive,
    3939            Options.quiet,
    40             Options.port,
    4140        ]
    4241
  • trunk/WebKitTools/Scripts/webkitpy/tool/steps/update.py

    r58328 r69737  
    3737        return AbstractStep.options() + [
    3838            Options.update,
    39             Options.port,
    4039        ]
    4140
Note: See TracChangeset for help on using the changeset viewer.