[Buildbot-commits] buildbot/buildbot interfaces.py,1.19,1.20

Brian Warner warner at users.sourceforge.net
Fri Oct 15 16:59:46 UTC 2004

Update of /cvsroot/buildbot/buildbot/buildbot
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8340/buildbot

Modified Files:
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: interfaces.py
RCS file: /cvsroot/buildbot/buildbot/buildbot/interfaces.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- interfaces.py	30 Sep 2004 10:05:44 -0000	1.19
+++ interfaces.py	15 Oct 2004 16:59:44 -0000	1.20
@@ -258,6 +258,11 @@
         and will only be accessible through the IBuildStepStatus objects.
         Each log is an object which implements the IStatusLog interface."""
+    def getTestResults():
+        """Return a dictionary that maps test-name tuples to ITestResult
+        objects. This may return an empty or partially-filled dictionary
+        until the build has completed."""
     # subscription interface
     def subscribe(receiver, updateInterval=None):
@@ -270,6 +275,30 @@
         """Unregister an IStatusReceiver. No further status messgaes will be
+class ITestResult(Interface):
+    """I describe the results of a single unit test."""
+    def getName():
+        """Returns a tuple of strings which make up the test name. Tests may
+        be arranged in a hierarchy, so looking for common prefixes may be
+        useful."""
+    def getResults():
+        """Returns a constant describing the results of the test: SUCCESS,
+        WARNINGS, FAILURE."""
+    def getText():
+        """Returns a list of short strings which describe the results of the
+        test in slightly more detail. Suggested components include
+        'failure', 'error', 'passed', 'timeout'."""
+    def getLogs():
+        # in flux, it may be possible to provide more structured information
+        # like python Failure instances
+        """Returns a dictionary of test logs. The keys are strings like
+        'stdout', 'log', 'exceptions'. The values are strings."""
 class IBuildStepStatus(Interface):
     """I hold status for a single BuildStep."""

More information about the Commits mailing list