diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index caea8867..00000000 --- a/.coveragerc +++ /dev/null @@ -1,6 +0,0 @@ -[report] -# Regexes for lines to exclude from consideration -exclude_lines = - if __name__ == .__main__.: -include= - hooks/nova_* diff --git a/.zuul.yaml b/.zuul.yaml index 7051aeeb..dc276615 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,3 +1,4 @@ - project: templates: - python35-charm-jobs + - openstack-cover-jobs diff --git a/tox.ini b/tox.ini index 353aacfa..faf542a0 100644 --- a/tox.ini +++ b/tox.ini @@ -40,6 +40,34 @@ deps = -r{toxinidir}/requirements.txt commands = flake8 {posargs} hooks unit_tests tests actions lib 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}