[Buildbot-devel] _pendingLogObservers
John Wieland
johnny.c.sparkles at gmail.com
Fri Jul 23 22:59:45 UTC 2010
Hi All,
I am using Buildbot 0.8.0 and have followed the example in the most recent
version of the documentation about writing custom build steps to create a
BuildStep similar to the Framboozle build step. Here is my code:
import re
from buildbot.steps import shell
from buildbot.process.buildstep import LogLineObserver
class R_TestParser(LogLineObserver):
total_tests = 0
pass_tests = 0
fail_tests = 0
skip_tests = 0
current_test = ""
def __init__(self)
LogLineObserver.__init__(self)
def outLineReceived(self, line):
if "TEST_EXE:BEGIN" in line:
# Get the test name
re.search('TEST_EXE:BEGIN:(.*)--#', line)
current_test = re.group(0)
self.numTests += 1
self.step.setProgress('tests', self.numTests)
elif "TEST:SUCCESS" in line:
pass_tests += 1
print "Pass tests" + pass_tests
elif "TEST:FAIL" in line:
fail_tests += 1
elif "TEST:SKIP" in line:
skip_tests += 1
elif "TEST_EXE:END" in line:
self.numTests += 1
class R_TestStep(shell.ShellCommand):
command = ['sh', 'buildrmt.sh']
def __init__(self, **kwargs):
ShellCommand.__init__(self, **kwargs)
observer = R_TestParser()
self.addLogObserver('stdio', observer)
self.progressMetrics += ('tests',)
When attempting to reconfigure the build master I get the following:
File
"/usr/local/lib/python2.6/dist-packages/buildbot/process/buildstep.py", line
939, in addLogObserver
self._pendingLogObservers.append((logname, observer))
exceptions.AttributeError: R_TestStep instance has no attribute
'_pendi
ngLogObservers'
2010-07-24 08:53:49+1000 [-] The new config file is unusable, so I'll ignore
it.
I've checked that the R_TestStep inherits from ShellCommand, which inherits
from BuildStep. I see that BuildStep uses the _pendingLogObservers variable
in its member functions but does not declare it as a class variable anywhere
(I'm new to python so wasn't exactly sure if this is standard syntax).
Does anyone have any ideas? Buildbot seems like a big step up from tinderbox
which I have been using for some time but if I can't get some
post-processing of test logs working I'm not sure I can continue with it.
Thanks,
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20100724/f3b98807/attachment.html>
More information about the devel
mailing list