[Buildbot-commits] buildbot/buildbot/steps shell.py,1.27,1.28

Brian Warner warner at users.sourceforge.net
Thu Jul 24 00:57:58 UTC 2008


Update of /cvsroot/buildbot/buildbot/buildbot/steps
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21175/buildbot/steps

Modified Files:
	shell.py 
Log Message:
[project @ 	* buildbot/steps/shell.py (Test.setTestResults): set statistics]
	with names like "tests-total" instead of just "total".
	(Test.getText): same
	* buildbot/test/test_steps.py (PerlModuleTest): use
	getStatistic (with "tests-total") instead of getProperty, and call
	it on the step_status, not the step itself. This pair makes the
	PerlModuleTest pass again


Original author: warner at lothar.com
Date: 2008-07-24 00:20:05+00:00

Index: shell.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/shell.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- shell.py	21 Jul 2008 17:52:16 -0000	1.27
+++ shell.py	24 Jul 2008 00:57:56 -0000	1.28
@@ -371,21 +371,23 @@
         Called by subclasses to set the relevant statistics; this actually
         adds to any statistics already present
         """
-        total += self.step_status.getStatistic('total', 0)
-        self.step_status.setStatistic('total', total)
-        failed += self.step_status.getStatistic('failed', 0)
-        self.step_status.setStatistic('failed', failed)
-        warnings += self.step_status.getStatistic('warnings', 0)
-        self.step_status.setStatistic('warnings', warnings)
-        passed += self.step_status.getStatistic('passed', 0)
-        self.step_status.setStatistic('passed', passed)
+        total += self.step_status.getStatistic('tests-total', 0)
+        self.step_status.setStatistic('tests-total', total)
+        failed += self.step_status.getStatistic('tests-failed', 0)
+        self.step_status.setStatistic('tests-failed', failed)
+        warnings += self.step_status.getStatistic('tests-warnings', 0)
+        self.step_status.setStatistic('tests-warnings', warnings)
+        passed += self.step_status.getStatistic('tests-passed', 0)
+        self.step_status.setStatistic('tests-passed', passed)
 
     def getText(self, cmd, results):
-        if self.step_status.hasStatistic('total'):
-            total, failed, passed, warnings = \
-                [ self.step_status.getStatistic(n,0)
-                  for n in 'total', 'failed', 'passed', 'warnings' ]
-            if not total: total = failed + passed + warnings
+        if self.step_status.hasStatistic('tests-total'):
+            total = self.step_status.getStatistic("tests-total", 0)
+            failed = self.step_status.getStatistic("tests-failed", 0)
+            passed = self.step_status.getStatistic("tests-passed", 0)
+            warnings = self.step_status.getStatistic("tests-warnings", 0)
+            if not total:
+                total = failed + passed + warnings
 
             rv = []
             if total: rv.append('%d tests' % total)





More information about the Commits mailing list