Fix the coverage job in tox

This commit fixes the coverage job in tox. It relies on pbr to
actually make the coverage calls before and after running the tests.
However, by default pbr assumes the project name in setup.cfg is the
same as the directory containing the source. However that isn't the
case here. This commits corrects this by using the flag to pretend
that package name is the same as the source dir. This change also
sets the correct regex for testr to run the unit tests only, which is
what is needed for the coverage job. The pbr requirement is also
updated to be >=0.8.1 because this is the min version required to
use the option exploited by this patch.

Change-Id: Icea30575538571fe842632901e994be3ac0bbc80
This commit is contained in:
Matthew Treinish 2014-07-25 21:26:21 -04:00
parent 8d2c7e7d51
commit 20871dad7c
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ python-daemon
irc
pyyaml
lockfile
pbr>=0.6,!=0.7,<1.0
pbr>=0.8.1,<1.0
Babel>=0.9.6
launchpadlib
Jinja2

View File

@ -22,7 +22,7 @@ commands = flake8
commands = {posargs}
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
commands = python setup.py testr --coverage --coverage-package-name='elastic_recheck' --testr-args='{posargs} tests.unit'
[testenv:run]
# test to run the bot as a non voting foreground process