I recently ran into the issue that our Hudson installation didn’t report test failures. After digging for a bit, I discovered, that scripts installed by zc.recipe.egg don’t return the exit code for some cases. There is a bugreport at https://bugs.launchpad.net/zc.buildout/+bug/164629. In our case the generated coverage script depended on this and because the sys.exit was missing, the test failures were masked.
The following is a way to fix this in your buildouts now until it’s fixed in zc.buildout:
[buildout]
extensions = buildout.extensionscripts
extension-scripts =
${buildout:directory}/src/buildout-utils.py:patchScriptGeneration
The patchScriptGeneration function in src/buildout-utils.py looks like this:
def patchScriptGeneration(buildout):
from zc.buildout import easy_install
if not 'sys.exit(' in easy_install.script_template:
easy_install.script_template = easy_install.script_template.replace(
"%(module_name)s.%(attrs)s(%(arguments)s)",
"sys.exit(%(module_name)s.%(attrs)s(%(arguments)s))")
Advertisement






Thanks for this post, still it doesn’t seems to work for me:
$bin/develop rb; echo “Exit code: ” $?
Last used buildout arguments: -c alin.cfg
INFO: Running buildout.
Getting distribution for ‘buildout.extensionscripts’.
….
mr.developer: git remote of ‘p4a.common’ failed.
mr.developer: fatal: Not a git repository (or any parent up to mount parent )
mr.developer: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
mr.developer:
mr.developer: Updated ‘eea.translations’ with subversion.
mr.developer: Updated ‘eea.versions’ with subversion.
mr.developer: Updated ‘eea.vocab’ with subversion.
mr.developer: Updated ‘eea.workflow’ with subversion.
mr.developer: There have been errors, see messages above.
Exit code: 0