[tahoe-lafs-trac-stream] [tahoe-lafs] #1296: 'tahoe debug trial' command
tahoe-lafs
trac at tahoe-lafs.org
Tue Jan 18 06:28:35 UTC 2011
#1296: 'tahoe debug trial' command
-----------------------------------+----------------------------------------
Reporter: davidsarah | Owner: davidsarah
Type: defect | Status: assigned
Priority: major | Milestone: 1.8.2
Component: code-frontend-cli | Version: 1.8.1
Resolution: | Keywords: bbfreeze setuptools review-needed
Launchpad Bug: |
-----------------------------------+----------------------------------------
Comment (by warner):
The following appears to work great, at least for things like "{{{tahoe
debug trial}}}", "{{{tahoe debug trial allmydata.test.test_foo}}}", and
"{{{tahoe debug trial --random-option random-argument}}}". It depends upon
the fact that {{{TrialOptions}}} doesn't actually take any options or
arguments: everything gets passed through to {{{trial.run()}}}:
{{{
class TrialOptions(twisted_trial.Options):
def getSynopsis(self):
return "Usage: tahoe debug trial [options]
[[file|package|module|TestCase|testmethod]...]"
def parseOptions(self, options):
self.options = options
def getUsage(self, width=None):
t = twisted_trial.Options.getUsage(self, width)
t += """
The 'tahoe debug trial' command uses the correct imports for this instance
of
Tahoe-LAFS. The default test suite is 'allmydata.test'.
"""
return t
def trial(config):
sys.argv = ['trial'] + list(config.options)
if not config.options:
sys.argv += ['allmydata.test']
# This does not return.
twisted_trial.run()
}}}
--
Ticket URL: <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1296#comment:14>
tahoe-lafs <http://tahoe-lafs.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list