Test everything in your buildout

Tags: buildout

Test driven development is great. So I’m used to having a bin/test in my buildout that runs the tests of the package I’m developing. Now it is also easy to test your dependencies, too. Automatically.

When combining packages, it is handy to also run the tests of the packages you depend on. Most important question: is the combination of versions of my dependencies valid?

Till now, in our projects we had a [test-all] part in addition to our [test] that had a bigger list of eggs: it included the main packages (mostly our own) that the product depends on. One drawback: the list needs manual maintenance. If you add a dependency, it is easy to forget to add it to the test-all list.

Solution: plone.recipe.alltests by Hanno Schlichting. I’m lazy, so I made a small addition to it today that sets some defaults for options that are basically always the same. Getting a bin/test-all that runs all tests of all the dependencies of your main product only needs the following two lines in your buildout (and of course the name of your part in the parts list):

recipe = plone.recipe.alltests

Read the pypi page for the other options (custom set of eggs; grouping; exclude lists).

One problem: there are lots of breaking tests in zope.app.* as used by grok (and probably others) now. At least in the combination. Mostly faulty imports because of the dependency reduction work done earlier this year, as far as I could see. Well, that’s what the “exclude” option of plone.recipe.alltests is for. For the time being. But all the tests run automatically: happy as a pig in mud.

Pigs in the Tiergarten Nordhorn in Germany
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):