Changeset 51622 in webkit


Ignore:
Timestamp:
Dec 2, 2009 9:31:48 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-02 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

REGRESSION(51595): commit-queue is throwing exceptions
https://bugs.webkit.org/show_bug.cgi?id=32083

  • Scripts/modules/commands/queues.py:
    • Don't use default value of [] as it ends up getting shared.
    • Make log_progress accept arrays of ints as well as strings.
    • Return an exit code from execute()
  • Scripts/modules/commands/queues_unittest.py: Added.
    • Test to make sure log_progress will accept ints.
    • Test to make sure run_bugzilla_tool will accept ints.
  • Scripts/modules/workqueue.py:
    • Print the stack trace on unexpected exceptions for easier debugging.
  • Scripts/run-webkit-unittests:
    • Add queues_unittest.
  • Scripts/modules/commands/queues.py:
  • Scripts/modules/commands/queues_unittest.py: Copied from WebKitTools/Scripts/modules/commands/commandtest.py.
  • Scripts/modules/mock_bugzillatool.py:
  • Scripts/modules/workqueue.py:
  • Scripts/run-webkit-unittests:
Location:
trunk/WebKitTools
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r51619 r51622  
     12009-12-02  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        REGRESSION(51595): commit-queue is throwing exceptions
     6        https://bugs.webkit.org/show_bug.cgi?id=32083
     7
     8        * Scripts/modules/commands/queues.py:
     9         - Don't use default value of [] as it ends up getting shared.
     10         - Make log_progress accept arrays of ints as well as strings.
     11         - Return an exit code from execute()
     12        * Scripts/modules/commands/queues_unittest.py: Added.
     13         - Test to make sure log_progress will accept ints.
     14         - Test to make sure run_bugzilla_tool will accept ints.
     15        * Scripts/modules/workqueue.py:
     16         - Print the stack trace on unexpected exceptions for easier debugging.
     17        * Scripts/run-webkit-unittests:
     18         - Add queues_unittest.
     19
     20        * Scripts/modules/commands/queues.py:
     21        * Scripts/modules/commands/queues_unittest.py: Copied from WebKitTools/Scripts/modules/commands/commandtest.py.
     22        * Scripts/modules/mock_bugzillatool.py:
     23        * Scripts/modules/workqueue.py:
     24        * Scripts/run-webkit-unittests:
     25
    1262009-12-02  David Levin  <levin@chromium.org>
    227
  • trunk/WebKitTools/Scripts/modules/commands/queues.py

    r51590 r51622  
    4747class AbstractQueue(Command, WorkQueueDelegate):
    4848    watchers = "webkit-bot-watchers@googlegroups.com"
    49     def __init__(self, options=[]):
    50         options += [
     49    def __init__(self, options=None): # Default values should never be collections (like []) as default values are shared between invocations
     50        options_list = (options or []) + [
    5151            make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Do not ask the user for confirmation before running the queue.  Dangerous!"),
    5252            make_option("--status-host", action="store", type="string", dest="status_host", default=StatusBot.default_host, help="Hostname (e.g. localhost or commit.webkit.org) where status updates should be posted."),
    5353        ]
    54         Command.__init__(self, "Run the %s" % self.name, options=options)
     54        Command.__init__(self, "Run the %s" % self.name, options=options_list)
    5555
    5656    def _cc_watchers(self, bug_id):
     
    9393
    9494    def run_bugzilla_tool(self, args):
    95         bugzilla_tool_args = [self.tool.path()] + args
     95        bugzilla_tool_args = [self.tool.path()] + map(str, args)
    9696        run_and_throw_if_fail(bugzilla_tool_args)
    9797
    9898    def log_progress(self, patch_ids):
    99         log("%s in %s [%s]" % (pluralize("patch", len(patch_ids)), self.name, ", ".join(patch_ids)))
     99        log("%s in %s [%s]" % (pluralize("patch", len(patch_ids)), self.name, ", ".join(map(str, patch_ids))))
    100100
    101101    def execute(self, options, args, tool):
     
    103103        self.tool = tool
    104104        work_queue = WorkQueue(self.name, self)
    105         work_queue.run()
     105        return work_queue.run()
    106106
    107107
     
    147147
    148148class AbstractTryQueue(AbstractQueue, PersistentPatchCollectionDelegate, LandingSequenceErrorHandler):
    149     def __init__(self, options=[]):
     149    def __init__(self, options=None):
    150150        AbstractQueue.__init__(self, options)
    151151
  • trunk/WebKitTools/Scripts/modules/mock_bugzillatool.py

    r51464 r51622  
    131131    def scm(self):
    132132        return self._scm
     133
     134    def path(self):
     135        return "echo"
  • trunk/WebKitTools/Scripts/modules/workqueue.py

    r51277 r51622  
    3131import os
    3232import time
     33import traceback
    3334
    3435from datetime import datetime, timedelta
     
    105106                    continue
    106107                self.status_bot.update_status(self._name, waiting_message, patch)
     108            except KeyboardInterrupt, e:
     109                log("\nUser terminated queue.")
     110                return 1
    107111            except Exception, e:
     112                traceback.print_exc()
    108113                # Don't try tell the status bot, in case telling it causes an exception.
    109114                self._sleep("Exception while preparing queue: %s." % e)
  • trunk/WebKitTools/Scripts/run-webkit-unittests

    r51442 r51622  
    3636from modules.commands.upload_unittest import *
    3737from modules.commands.queries_unittest import *
     38from modules.commands.queues_unittest import *
    3839from modules.committers_unittest import *
    3940from modules.cpp_style_unittest import *
Note: See TracChangeset for help on using the changeset viewer.