views:

243

answers:

1

I completed this tutorial from Joe Heck to set up Hudson for Python. Everything worked perfectly except the Coverage section. My build failed with this output:

[workspace] $ /bin/sh -xe /tmp/hudson6222564272447222496.sh
+ coverage run tests/run.py --with-xunit
You must specify at least one of -e, -x, -c, -r, or -a.

I tried to include the Execute argument, -x, but got an exception that was ultimately caused by a permissions failure:

IOError: [Errno 13] Permission denied: 'nosetests.xml'

Has anyone gotten Coverage working successfully with Hudson?

+4  A: 

You have an old version of coverage.py, it looks like 2.x of some sort. "coverage run" is new syntax with coverage.py 3.x. Download the latest coverage.py at http://pypi.python.org/pypi/coverage, and you should be good to go.

Ned Batchelder
At first, I couldn't figure out why I couldn't get the latest version of coverage installed. Then I realized the root problem was with my setuptools. I had version 0.6c9 (Ubuntu 9.1). To get coverage 3.2, 0.6c11 has to be installed. Visit http://pypi.python.org/pypi/setuptools and install manually rather than using Ubuntu's aptitude or apt-get python-tools.
Wraith