Tweaked the UnitTest description of buildbot master.cfg.

- Legacy-Id: 9261
This commit is contained in:
buildbot 2015-03-19 23:48:41 +00:00
parent 5fd5e56fcc
commit 7e12beb551

View file

@ -94,7 +94,7 @@ class UnitTest(WarningCountingShellCommand):
command = ["python", "-m", "unittest", "discover"]
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",
"skipped": "(?:OK|FAILED).*\skipped=(\d+)",
"failed": "FAILED.*failures\=(\d+)",
@ -138,10 +138,15 @@ class UnitTest(WarningCountingShellCommand):
description = WarningCountingShellCommand.describe(self, done)
if done:
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:
value = self.step_status.getStatistic(name)
displayName = name.replace('_', ' ').capitalize()
displayName = name.replace('_', ' ')
if type(value) is float: # this is run-time
description.append('%s: %.2fs' % (displayName, value))
elif type(value) is int: