Add cover target and zuul configuration

Enable unit testing coverage reporting.

Change-Id: I4d0cf0ae1716d880bfc2c73735ac2e1b6ec1c0d7
This commit is contained in:
James Page
2024-08-02 14:38:46 +01:00
parent b903273d28
commit 4b9330b438
2 changed files with 26 additions and 0 deletions

View File

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

25
tox.ini
View File

@@ -31,6 +31,31 @@ basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands = flake8 {posargs} charms_openstack unit_tests
[testenv:cover]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
setenv =
{[testenv]setenv}
PYTHON=coverage run
commands =
coverage erase
stestr run {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/*
unit_tests/*
*/templates/*
[testenv:venv]
basepython = python3
commands = {posargs}