本文整理汇总了Python中buildbot.steps.shell.Test类的典型用法代码示例。如果您正苦于以下问题:Python Test类的具体用法?Python Test怎么用?Python Test使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Test类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self,
fileloc=None,
config=None,
**kwargs):
"""
Create the Rpmlint object.
@type fileloc: str
@param fileloc: Location glob of the specs or rpms.
@type config: str
@param config: path to the rpmlint user config.
@type kwargs: dict
@param fileloc: all other keyword arguments.
"""
Test.__init__(self, **kwargs)
if fileloc:
self.fileloc = fileloc
if config:
self.config = config
self.addFactoryArguments(fileloc=fileloc, config=config)
self.command = ["rpmlint", "-i"]
if self.config:
self.command += ['-f', self.config]
self.command.append(self.fileloc)
self.obs = pkgutil.WEObserver()
self.addLogObserver('stdio', self.obs)
示例2: __init__
def __init__(self, ignore=[], flaky=[], max_logs=20,
*args, **kwargs):
Test.__init__(self, *args, **kwargs)
self.maxLogs = int(max_logs)
self.logObserver = LitLogObserver(self.maxLogs)
self.addFactoryArguments(max_logs=max_logs)
self.addLogObserver('stdio', self.logObserver)
示例3: __init__
def __init__(self, dbpool=None, test_type="mysql-test-run", test_info="",
autoCreateTables=False, textLimit=5, testNameLimit=16,
parallel=4, logfiles = {}, lazylogfiles = True, **kwargs):
# Add mysql server logfiles.
for mtr in range(0, parallel+1):
for mysqld in range(1, 4+1):
if mtr == 0:
logname = "mysqld.%d.err" % mysqld
filename = "mysql-test/var/log/mysqld.%d.err" % mysqld
else:
logname = "mysqld.%d.err.%d" % (mysqld, mtr)
filename = "mysql-test/var/%d/log/mysqld.%d.err" % (mtr, mysqld)
logfiles[logname] = filename
Test.__init__(self, logfiles=logfiles, lazylogfiles=lazylogfiles, **kwargs)
self.dbpool = dbpool
self.test_type = test_type
self.test_info = test_info
self.autoCreateTables = autoCreateTables
self.textLimit = textLimit
self.testNameLimit = testNameLimit
self.parallel = parallel
self.progressMetrics += ('tests',)
self.addFactoryArguments(dbpool=self.dbpool,
test_type=self.test_type,
test_info=self.test_info,
autoCreateTables=self.autoCreateTables,
textLimit=self.textLimit,
testNameLimit=self.testNameLimit,
parallel=self.parallel)
示例4: __init__
def __init__(self, dbpool=None, test_type="mysql-test-run", test_info="",
autoCreateTables=False, textLimit=5, testNameLimit=16,
parallel=4, logfiles = {}, lazylogfiles = True,
warningPattern="MTR's internal check of the test case '.*' failed",
mtr_subdir="mysql-test", **kwargs):
Test.__init__(self, logfiles=logfiles, lazylogfiles=lazylogfiles,
warningPattern=warningPattern, **kwargs)
self.dbpool = dbpool
self.test_type = test_type
self.test_info = test_info
self.autoCreateTables = autoCreateTables
self.textLimit = textLimit
self.testNameLimit = testNameLimit
self.parallel = parallel
self.mtr_subdir = mtr_subdir
self.progressMetrics += ('tests',)
self.addFactoryArguments(dbpool=self.dbpool,
test_type=self.test_type,
test_info=self.test_info,
autoCreateTables=self.autoCreateTables,
textLimit=self.textLimit,
testNameLimit=self.testNameLimit,
parallel=self.parallel,
mtr_subdir=self.mtr_subdir)
示例5: __init__
def __init__(self, dbpool=None, test_type=None, test_info="",
description=None, descriptionDone=None,
autoCreateTables=False, textLimit=5, testNameLimit=16,
parallel=4, logfiles=None, lazylogfiles=True,
warningPattern="MTR's internal check of the test case '.*' failed",
mtr_subdir="mysql-test", **kwargs):
if logfiles is None:
logfiles = {}
if description is None:
description = ["testing"]
if test_type:
description.append(test_type)
if descriptionDone is None:
descriptionDone = ["test"]
if test_type:
descriptionDone.append(test_type)
Test.__init__(self, logfiles=logfiles, lazylogfiles=lazylogfiles,
description=description, descriptionDone=descriptionDone,
warningPattern=warningPattern, **kwargs)
self.dbpool = dbpool
self.test_type = test_type
self.test_info = test_info
self.autoCreateTables = autoCreateTables
self.textLimit = textLimit
self.testNameLimit = testNameLimit
self.parallel = parallel
self.mtr_subdir = mtr_subdir
self.progressMetrics += ('tests',)
示例6: setTestResults
def setTestResults(self, total, failed, passed, total_statements,
exec_statements):
Test.setTestResults(self, total=total, failed=failed, passed=passed)
total_statements += self.step_status.getStatistic("total-statements", 0)
self.step_status.setStatistic("total-statements", total_statements)
exec_statements += self.step_status.getStatistic("exec-statements", 0)
self.step_status.setStatistic("exec-statements", exec_statements)
示例7: __init__
def __init__(self, fileloc="*rpm", **kwargs):
"""
Create the Rpmlint object.
@type fileloc: str
@param fileloc: Location glob of the specs or rpms.
@type kwargs: dict
@param fileloc: all other keyword arguments.
"""
Test.__init__(self, **kwargs)
self.command = ["/usr/bin/rpmlint", "-i"]
self.command.append(fileloc)
示例8: describe
def describe(self, done=False):
description = Test.describe(self, done)
for name, count in self.logObserver.resultCounts.iteritems():
if name in self.resultNames:
description.append('{0} {1}'.format(count, self.resultNames[name]))
else:
description.append('Unexpected test result output ' + name)
return description
示例9: __init__
def __init__(self, python, db, verbosity=2, **kwargs):
kwargs["command"] = [
"../venv-python%s-%s%s/bin/python" % (python, db.name, db.version),
"tests/runtests.py",
"--settings=testsettings",
"--verbosity=%s" % verbosity,
]
kwargs["env"] = {"PYTHONPATH": "$PWD:$PWD/tests", "LC_ALL": "en_US.utf8"}
Test.__init__(self, **kwargs)
# Make sure not to spuriously count a warning from test cases
# using the word "warning". So skip any "warnings" on lines starting
# with "test_"
self.addSuppression([(None, "^test_", None, None)])
self.addFactoryArguments(python=python, db=db, verbosity=verbosity)
示例10: describe
def describe(self, done=False):
description = Test.describe(self, done)
if done:
if self.step_status.hasStatistic("total-statements"):
total_statements = self.step_status.getStatistic("total-statements")
exec_statements = self.step_status.getStatistic("exec-statements")
if total_statements > 0:
coverage_pct = (float(exec_statements) /
float(total_statements) * 100)
description.append('%d%% code coverage (%d / %d statements)'
% (coverage_pct, exec_statements,
total_statements))
return description
示例11: describe
def describe(self, done=False):
description = Test.describe(self, done)
for name, count in self.logObserver.resultCounts.iteritems():
description.append('{0} {1}'.format(count, self.resultNames[name]))
return description
示例12: evaluateCommand
def evaluateCommand(self, cmd):
if self.failed__:
return FAILURE
return Test.evaluateCommand(self, cmd)
示例13: __init__
def __init__(self, **kwargs):
self.failed__ = False # there's a 'failed' method in Test, ouch!
Test.__init__(self, **kwargs)
示例14: __init__
def __init__(self, ignore=[], flaky=[], max_logs=20, *args, **kwargs):
Test.__init__(self, *args, **kwargs)
self.logObserver = DejaGNULogObserver()
self.addLogObserver("gdb.log", self.logObserver)
示例15: afterRegisterInDB
def afterRegisterInDB(self, insert_id):
self.setProperty("mtr_id", insert_id)
self.setProperty("mtr_warn_id", 0)
Test.start(self)