Merge "Added tox environment for gathering coverage"

This commit is contained in:
Zuul 2019-03-04 09:39:07 +00:00 committed by Gerrit Code Review
commit 4da15f7132
3 changed files with 29 additions and 6 deletions

View File

@ -1,6 +0,0 @@
[report]
# Regexes for lines to exclude from consideration
exclude_lines =
if __name__ == .__main__.:
include=
hooks/rabbit*

View File

@ -1,3 +1,4 @@
- project:
templates:
- python35-charm-jobs
- openstack-cover-jobs

28
tox.ini
View File

@ -39,6 +39,34 @@ deps = -r{toxinidir}/requirements.txt
commands = flake8 {posargs} hooks unit_tests tests actions lib scripts
charm-proof
[testenv:cover]
# Technique based heavily upon
# https://github.com/openstack/nova/blob/master/tox.ini
basepython = python3
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
setenv =
{[testenv]setenv}
PYTHON=coverage run
commands =
coverage erase
ostestr {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[coverage:run]
branch = True
concurrency = multiprocessing
parallel = True
source =
.
omit =
.tox/*
*/charmhelpers/*
unit_tests/*
[testenv:venv]
basepython = python3
commands = {posargs}