Fix the 'cover' tox env

currently tox env for code coverage does not measure anything
as it tries to measure the coverage of 'ironic-staging-drivers' package,
while the actual package name is 'ironic_staging_drivers'.

This patch:
- erases current coverage data first
- fixes project name expected by 'coverage'
- adds coverage reporting in the end of 'tox -ecover' run
- omits tests file from both coverage and report
- adds 'cover' to .gitignore (auto-generated as part of coverage report)

Change-Id: I0044e3dd399934be706a06fd921972632efcceea
This commit is contained in:
Pavlo Shchelokovskyy
2016-12-14 19:24:33 +02:00
parent fd7a07f981
commit 7b3e177723
2 changed files with 5 additions and 1 deletions

1
.gitignore vendored
View File

@@ -24,6 +24,7 @@ pip-log.txt
# Unit test / coverage reports
.coverage
cover
.tox
nosetests.xml
.testrepository

View File

@@ -26,7 +26,10 @@ commands =
commands = {posargs}
[testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}'
commands =
coverage erase
python setup.py test --coverage --omit '*test*' --coverage-package-name ironic_staging_drivers --testr-args='{posargs}'
coverage report --omit='*test*'
[testenv:docs]
commands = python setup.py build_sphinx