Add better coverage support under tox
For those in the community who don't use run_tests.sh but want tox to have coverage support this small change should help. It adds coverage erase, combine, html reporting. It also fixes the coverage unit tests in two ways. The first is adding the locking like normal unit tests. The second is adding substring regular expression matching to pick a subset of tests. This brings it up to closer par with run_tests.sh. Change-Id: If9ea229425dc9a191fa7c5cc073cf5da412a69b7
This commit is contained in:
1 changed files with 5 additions and 2 deletions
7
tox.ini
7
tox.ini
@@ -36,8 +36,11 @@ commands = bash tools/lintstack.sh
# tests conflict with coverage.
setenv = VIRTUAL_ENV={envdir}
commands =
python setup.py testr --coverage \
--testr-args='^(?!.*test.*coverage).*$'
coverage erase
python -m nova.openstack.common.lockutils python setup.py testr --coverage \
--testr-args='(?=.*{posargs})^(?!.*test.*coverage).*$'
coverage combine
coverage html --include='nova/*' --omit='nova/openstack/common/*' -d covhtml -i
[testenv:venv]
commands = {posargs}
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.