Buildbot is a great continuous integration tool, and PyTest, aka py.test, is a great unit testing tool.
But there’s an impedance mismatch between them.
In Buildbot, a ShellCommand is deemed to have failed if it returns a non-zero exit status, and succeeded if it returns a zero exit status.
Py.test always returns a zero status. I guess their philosophy is: Py.test didn’t crash, so it was “successful,” and the exit status should be 0. So, when py.test returns a 0 status, Buildbot deems the ShellCommand successful — and therefore, the build “succeeded,” no build failure email is generated, and the buildbot waterfall remains green.
You’d think that py.test would have a “––returnnonzerostatusonfailure” switch. But it doesn’t.
I found evidence on a mail archive that this problem has been around since 2005.
Am I missing something obvious, and if not, what’s the generally accepted way to work around this problem?
I got an answer from Brian Dorsey on the SeaPIG mailing list: