[Buildbot-devel] custom waterfall output for steps?

Brian Warner warner-buildbot at lothar.com
Tue Sep 12 17:03:08 UTC 2006


>    I have some steps that can report additional information, like
>    performance numbers, memory usage, screen captures of graphical tests,
>    etc.  I'd like to integrate these into the waterfall display, kind of
>    like the way Mozilla Tinderbox does.

The two things that are easy to do right now are to add URLs (which will
appear as simple text links) and to override the getText() method to add text
to the step's box.

To add a URL[1], put something like the following in a commandComplete() or
createSummary() method:

    self.addURL("screencap", "http://somewhere/thumbnail.png")

To add text to the step's waterfall box, do something like this:

    def getText(self, cmd, results):
        words = []
        if results == FAILURE:
            words.append("failed")
        words.append("mem=%dMB" % self.memory_usage_mb)
        words.append("perf=%d" % self.performance_number)
        return words

And of course, your commandComplete() method could grep stdout for these
numbers, then stash them in self.memory_usage_mb etc. You might also want to
set a build property[2] with them so they'll be saved in the persistent build
status:

        self.setProperty("memory_usage_mb", number)

(eventually, when we move to a proper database backend, you'll be able to
read these build properties as database columns, so you'll be able to
construct SQL queries to do stuff like graph memory usage over time or
whatever).


To do more involved things than this, you'll need to modify the Waterfall
code (probably buildbot/status/html.py:StepBox.getBox) to look for some
special attributes of the Step and display them in a special way. For
example, you might have StepBox look for a "thumbnail" build property, and if
one is present, add an inline <IMG> link into the generated HTML.

hope that helps,
 -Brian

[1]: http://buildbot.sourceforge.net/manual-0.7.4.html#BuildStep-URLs
[2]: http://buildbot.sourceforge.net/manual-0.7.4.html#Build-Properties




More information about the devel mailing list