[Buildbot-commits] buildbot/buildbot/status builder.py,1.38,1.39
Brian Warner
warner at users.sourceforge.net
Fri Oct 15 16:59:46 UTC 2004
Update of /cvsroot/buildbot/buildbot/buildbot/status
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8340/buildbot/status
Modified Files:
builder.py
Log Message:
* buildbot/interfaces.py (IBuildStatus.getTestResults): new method
to retrieve a dict of accumulated test results
(ITestResult): define what a single test result can do
* buildbot/status/builder.py (TestResult): implement ITestResult
(BuildStatus.getTestResults): retrieve dict of TestResults
(BuildStatus.addTestResult): add TestResults
* buildbot/test/test_status.py (Results.testAddResults): test it
Index: builder.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/builder.py,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- builder.py 30 Sep 2004 23:38:08 -0000 1.38
+++ builder.py 15 Oct 2004 16:59:44 -0000 1.39
@@ -236,6 +236,28 @@
def finish(self):
self.finished = util.now()
+class TestResult:
+ __implements__ = interfaces.ITestResult,
+
+ def __init__(self, name, results, text, logs):
+ assert type(name) is tuple
+ self.name = name
+ self.results = results
+ self.text = text
+ self.logs = logs
+
+ def getName(self):
+ return self.name
+
+ def getResults(self):
+ return self.results
+
+ def getText(self):
+ return self.text
+
+ def getLogs(self):
+ return self.logs
+
class BuildStepStatus:
# note that these are created when the Build is set up, before each
@@ -469,9 +491,14 @@
text = []
color = None
results = None
+
+ # these lists/dicts are defined here so that unserialized instances have
+ # (empty) values. They are set in __init__ to new objects to make sure
+ # each instance gets its own copy.
watchers = []
updates = {}
finishedWatchers = []
+ testResults = {}
def __init__(self, parent, number):
self.builder = parent
@@ -480,6 +507,7 @@
self.updates = {}
self.finishedWatchers = []
self.steps = []
+ self.testResults = {}
# IBuildStatus
@@ -561,6 +589,9 @@
def getResults(self):
return self.results
+ def getTestResults(self):
+ return self.testResults
+
def getLogs(self):
# TODO: steps should contribute significant logs instead of this
# hack, which returns every log from every step. The logs should get
@@ -611,6 +642,9 @@
step.step_status = s
self.steps.append(s)
+ def addTestResult(self, result):
+ self.testResults[result.getName()] = result
+
def setSourceStamp(self, revision, patch=None):
self.sourceStamp = (revision, patch)
def setReason(self, reason):
More information about the Commits
mailing list