diff --git a/.gitignore b/.gitignore index 563bcd1..f1d9b8b 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ doc/build # pbr generates these AUTHORS ChangeLog + +.coverage +cover/ diff --git a/.zuul.yaml b/.zuul.yaml index caaa2f2..f2e40eb 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -38,6 +38,7 @@ - project: templates: + - openstack-cover-jobs - openstack-python3-train-jobs check: jobs: diff --git a/tox.ini b/tox.ini index 9ae56cf..5590843 100644 --- a/tox.ini +++ b/tox.ini @@ -73,3 +73,17 @@ commands = bandit -r kolla_cli [testenv:docs] basepython = python3 commands = ./builddocs.sh + +[testenv:cover] +basepython = python3 +setenv = VIRTUAL_ENV={envdir} + NOSE_WITH_COVERAGE=1 + NOSE_COVER_BRANCHES=1 + NOSE_COVER_HTML=1 + NOSE_COVER_HTML_DIR={toxinidir}/cover + PYTHON=coverage run --source kolla_cli --parallel-mode +commands = + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml