[Buildbot-devel] Extending ShellCommand
kir at lapshin.net
Wed Jul 7 15:49:05 UTC 2004
I just started playing with BuildBot, so want to apologize in advance
for potential FAQ.
First thing I want to congratulate developers for such a nice product.
It does require some polish, but even it is current state it is very
usable and has quite a lot of nice features missing in CruiseControl.
Thanks a lot!
I am trying to extend ShellCommand to run unittests and update status
nicely. Running unit tests works just fine, but updating status throws
an exception I can't decipher.
Here is relevant code:
name = 'unittests'
def __init__(self, **kwargs):
self.python = kwargs['python']
command = self.python + ' '
command += os.path.join('cmd', 'test_all.py')
self.command = command
verb = "testing"
def finishStatus(self, result):
verb = "unittests"
if type(result) == types.TupleType:
result, text_ignored = result
if result == FAILURE:
self.updateCurrentActivity(color="red", text=[verb, "failed"])
What happens is startStatus() updates status to yellow 'testing' as
expected, log link works just fine, but when step is done, whole build
gets marked as successful, while unittests step still remains in yellow
'testing' mode. Hitting on log link at this point genereates following
2004/07/06 21:16 EDT [HTTPChannel,0,127.0.0.1] Traceback (most recent
"/usr/lib/python2.3/site-packages/twisted/protocols/basic.py", line 223,
why = self.lineReceived(line)
"/usr/lib/python2.3/site-packages/twisted/protocols/http.py", line 965,
"/usr/lib/python2.3/site-packages/twisted/protocols/http.py", line 1006,
req.requestReceived(command, path, version)
"/usr/lib/python2.3/site-packages/twisted/protocols/http.py", line 557,
--- <exception caught here> ---
line 165, in process
line 172, in render
body = resrc.render(self)
"/usr/lib/python2.3/site-packages/buildbot/status/event.py", line 384,
data += self.content(self.getEntries(), asText)
"/usr/lib/python2.3/site-packages/buildbot/status/event.py", line 356,
for type, entry in entries:
exceptions.TypeError: iteration over non-sequence
on line 356 of event.py entries is already None. Any ideas?
I am using buildbot 0.4.3 on Debian.
On a related note, buildbot did not like a couple of our unittests. The
whole unittesting process was dying saying that it caught signal 1. The
very same tests run just fin on the same machine, run by the same user
from the same folder. On closer examination it turned out that gnuplot
related tests were to blame. They did not do anything special, just
tested usage of Gnuplot.py, which basically spawns gnuplot process and
pipes some data into it. Any ideas why tests may run fine from shell,
but not from buildbot?
More information about the devel