[Buildbot-commits] buildbot/buildbot/process step_twisted.py,1.64,1.65

Brian Warner warner at users.sourceforge.net
Sat Apr 2 20:20:18 UTC 2005


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

Modified Files:
	step_twisted.py 
Log Message:
(countFailedTests): the new trial in Twisted-2.0 emits a slightly different
status line than old trial ("PASSED.." instead of "OK.."). Handle it so we
don't mistakenly think the test count is unparseable.
(Trial.start): note that for some reason each build causes another copy of
self.testpath to be prepended to PYTHONPATH. This needs to be fixed but I'm
not sure quite where the problem is.


Index: step_twisted.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step_twisted.py,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- step_twisted.py	9 Dec 2004 10:24:56 -0000	1.64
+++ step_twisted.py	2 Apr 2005 20:20:15 -0000	1.65
@@ -99,6 +99,7 @@
     # lines[-2] is blank
     # lines[-1] is 'OK' or 'FAILED (failures=1, errors=12)'
     #  or 'FAILED (failures=1)'
+    #  or "PASSED (skips=N, successes=N)"  (for Twisted-2.0)
     # there might be other lines dumped here. Scan all the lines.
     res = {'total': None,
            'failures': 0,
@@ -111,7 +112,9 @@
         out = re.search(r'Ran (\d+) tests', l)
         if out:
             res['total'] = int(out.group(1))
-        if l.startswith("OK") or l.startswith("FAILED "):
+        if (l.startswith("OK") or
+            l.startswith("FAILED ") or
+            l.startswith("PASSED")):
             # the extra space on FAILED_ is to distinguish the overall
             # status from an individual test which failed. The lack of a
             # space on the OK is because it may be printed without any
@@ -126,6 +129,9 @@
             if out: res['expectedFailures'] = int(out.group(1))
             out = re.search(r'unexpectedSuccesses=(\d+)', l)
             if out: res['unexpectedSuccesses'] = int(out.group(1))
+            # successes= is a Twisted-2.0 addition, and is not currently used
+            out = re.search(r'successes=(\d+)', l)
+            if out: res['successes'] = int(out.group(1))
 
     return res
 
@@ -349,6 +355,8 @@
             if e is None:
                 self.cmd.args['env'] = {'PYTHONPATH': self.testpath}
             else:
+                # TODO: somehow, each build causes another copy of
+                # self.testpath to get prepended
                 if e.get('PYTHONPATH', "") == "":
                     e['PYTHONPATH'] = self.testpath
                 else:





More information about the Commits mailing list