[Buildbot-devel] Writing tests

Brian Warner warner-buildbot at lothar.com
Sat Dec 8 20:42:18 UTC 2007


On Mon, 3 Dec 2007 13:30:32 -0500
"Greg Ward" <gerg.ward+buildbot at gmail.com> wrote:

> I'm trying to write some unit tests for my Blocker build step (see
> thread "Difficulties with concurrency and dependencies").  Some things
> can be tested in isolation, but there are certain behaviours that (I
> think) need a full-blown Buildbot environment to test.  I see other
> tests use RunMixin to do some magic that creates this environment, but
> I got lost quickly.  Is there a guide to writing BB unit tests
> somewhere?  Or do I just have to read the code until I get it?

Yeah, that's tricky. I agree, you'll need something close to a full
environment for this sort of test. I'd recommend test_run.py as the place to
start: there are some tests in there now that might be close
(testConcurrencyLimit comes to mind). I think RunMixin is the right framework
to use.

There's no guide, unfortunately. Reading the code (or printing it out and
thwacking it into your forehead :) until enlightenment is achieved is the
best path currently available.

sorry,
 -Brian




More information about the devel mailing list