coverage.py) during the test run.
To use this little hack you will need a buildbot slave with access to a directory that gets published by some web server. The custom build step below puts the coverage report directly into that directory and then adds an URL to the report, that will be visible in buildbot, with a call to addURL().
import re from buildbot.process.properties import WithProperties from buildbot.steps.shell import ShellCommand class Nose(ShellCommand): def __init__(self): self.coverage_path = '/var/www/foo/coverage-%s' self.coverage_url = 'http://example.com/foo/coverage-%s' d = WithProperties('--cover-html-dir=' + self.coverage_path, 'buildnumber') command = ['nosetests', '--with-coverage', '--cover-erase', '--cover-html', d] ShellCommand.__init__(self, command=command) def describe(self, done=False): if not done: return 'testing' else: return 'test done' def createSummary(self, log): buildnumber = self.getProperty('buildnumber') coverage_index = (self.coverage_path + '/index.html') % buildnumber f = open(coverage_index) m = re.search(r'Percent: (\d+) %', f.read()) f.close() self.addURL("coverage %s%%" % m.group(1), self.coverage_url % buildnumber)Good enough for now.
An even nicer version of this build step would download all the coverage report files from the slave to the master. The master would then serve the files using it's web status application. This would eliminate the need for a web server on the slave. But that's the deluxe version, more on that later.