Tweaked the UnitTest description of buildbot master.cfg.
- Legacy-Id: 9261
This commit is contained in:
parent
5fd5e56fcc
commit
7e12beb551
|
@ -94,7 +94,7 @@ class UnitTest(WarningCountingShellCommand):
|
||||||
command = ["python", "-m", "unittest", "discover"]
|
command = ["python", "-m", "unittest", "discover"]
|
||||||
|
|
||||||
regexPatterns = {
|
regexPatterns = {
|
||||||
"total": "Ran (\d+) tests in [0-9.]+s",
|
"tests": "Ran (\d+) tests in [0-9.]+s",
|
||||||
"time": "Ran \d+ tests in ([0-9.]+)s",
|
"time": "Ran \d+ tests in ([0-9.]+)s",
|
||||||
"skipped": "(?:OK|FAILED).*\skipped=(\d+)",
|
"skipped": "(?:OK|FAILED).*\skipped=(\d+)",
|
||||||
"failed": "FAILED.*failures\=(\d+)",
|
"failed": "FAILED.*failures\=(\d+)",
|
||||||
|
@ -138,10 +138,15 @@ class UnitTest(WarningCountingShellCommand):
|
||||||
description = WarningCountingShellCommand.describe(self, done)
|
description = WarningCountingShellCommand.describe(self, done)
|
||||||
if done:
|
if done:
|
||||||
description = description[:] # make a private copy
|
description = description[:] # make a private copy
|
||||||
for name in ["time", "total", "skipped", "failed", "errors", "template_coverage", "url_coverage", "code_coverage", ]:
|
self.step_status.statistics["passed"] = (
|
||||||
|
self.step_status.getStatistic("tests",0) -
|
||||||
|
self.step_status.getStatistic("skipped",0) -
|
||||||
|
self.step_status.getStatistic("failed",0) -
|
||||||
|
self.step_status.getStatistic("errors",0))
|
||||||
|
for name in ["time", "tests", "passed", "skipped", "failed", "errors", "template_coverage", "url_coverage", "code_coverage", ]:
|
||||||
if name in self.step_status.statistics:
|
if name in self.step_status.statistics:
|
||||||
value = self.step_status.getStatistic(name)
|
value = self.step_status.getStatistic(name)
|
||||||
displayName = name.replace('_', ' ').capitalize()
|
displayName = name.replace('_', ' ')
|
||||||
if type(value) is float: # this is run-time
|
if type(value) is float: # this is run-time
|
||||||
description.append('%s: %.2fs' % (displayName, value))
|
description.append('%s: %.2fs' % (displayName, value))
|
||||||
elif type(value) is int:
|
elif type(value) is int:
|
||||||
|
|
Loading…
Reference in a new issue