Skip to content

Commit

Permalink
cleanup, order tests to correspond to the source file
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Apr 9, 2012
1 parent ff39fd2 commit 32c9ae4
Show file tree
Hide file tree
Showing 2 changed files with 392 additions and 375 deletions.
38 changes: 25 additions & 13 deletions master/buildbot/scripts/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@
# Note that the terms 'options' and 'config' are used intechangeably here - in
# fact, they are intercanged several times. Caveat legator.

DB_HELP = """
The --db string is evaluated to build the DB object, which specifies
which database the buildmaster should use to hold scheduler state and
status information. The default (which creates an SQLite database in
BASEDIR/state.sqlite) is equivalent to:
--db='sqlite:///state.sqlite'
To use a remote MySQL database instead, use something like:
--db='mysql://bbuser:bbpasswd@dbhost/bbdb'
"""

class BasedirMixin(object):

"""SubcommandOptions Mixin to handle subcommands that take a basedir
Expand All @@ -49,19 +62,6 @@ def postOptions(self):
self['basedir'] = os.path.abspath(self['basedir'])


DB_HELP = """
The --db string is evaluated to build the DB object, which specifies
which database the buildmaster should use to hold scheduler state and
status information. The default (which creates an SQLite database in
BASEDIR/state.sqlite) is equivalent to:
--db='sqlite:///state.sqlite'
To use a remote MySQL database instead, use something like:
--db='mysql://bbuser:bbpasswd@dbhost/bbdb'
"""

class UpgradeMasterOptions(BasedirMixin, base.SubcommandOptions):
optFlags = [
["quiet", "q", "Do not emit the commands being run"],
Expand Down Expand Up @@ -149,34 +149,39 @@ def postOptions(self):
raise usage.UsageError("log-count parameter needs to be an int "+
" or None")


class StopOptions(BasedirMixin, base.SubcommandOptions):
optFlags = [
["quiet", "q", "Do not emit the commands being run"],
]
def getSynopsis(self):
return "Usage: buildbot stop [<basedir>]"


class RestartOptions(BasedirMixin, base.SubcommandOptions):
optFlags = [
['quiet', 'q', "Don't display startup log messages"],
]
def getSynopsis(self):
return "Usage: buildbot restart [<basedir>]"


class StartOptions(BasedirMixin, base.SubcommandOptions):
optFlags = [
['quiet', 'q', "Don't display startup log messages"],
]
def getSynopsis(self):
return "Usage: buildbot start [<basedir>]"


class ReconfigOptions(BasedirMixin, base.SubcommandOptions):
optFlags = [
['quiet', 'q', "Don't display log messages about reconfiguration"],
]
def getSynopsis(self):
return "Usage: buildbot reconfig [<basedir>]"


class DebugClientOptions(base.SubcommandOptions):
optParameters = [
["master", "m", None,
Expand Down Expand Up @@ -210,6 +215,7 @@ def postOptions(self):
raise usage.UsageError("passwd must be specified: on the command "
"line or in ~/.buildbot/options")


class BaseStatusClientOptions(base.SubcommandOptions):
optFlags = [
['help', 'h', "Display this message"],
Expand Down Expand Up @@ -237,14 +243,17 @@ def parseArgs(self, *args):
if len(args) > 1:
raise usage.UsageError("I wasn't expecting so many arguments")


class StatusLogOptions(BaseStatusClientOptions):
def getSynopsis(self):
return "Usage: buildbot statuslog [options]"


class StatusGuiOptions(BaseStatusClientOptions):
def getSynopsis(self):
return "Usage: buildbot statusgui [options]"


class SendChangeOptions(base.SubcommandOptions):
def __init__(self):
base.SubcommandOptions.__init__(self)
Expand Down Expand Up @@ -468,6 +477,7 @@ def postOptions(self):
if not self['master']:
self['master'] = opts.get('masterstatus', None)


class TryServerOptions(base.SubcommandOptions):

optParameters = [
Expand All @@ -481,6 +491,7 @@ def postOptions(self):
if not self['jobdir']:
raise usage.UsageError('jobdir is required')


class CheckConfigOptions(base.SubcommandOptions):
optFlags = [
['quiet', 'q', "Don't display error messages or tracebacks"],
Expand Down Expand Up @@ -637,6 +648,7 @@ def postOptions(self):
raise usage.UsageError("cannot use --info with 'remove' "
"or 'get'")


class Options(usage.Options):
synopsis = "Usage: buildbot <command> [command options]"

Expand Down

0 comments on commit 32c9ae4

Please sign in to comment.