simplify and document how to measure code coverage

This patch configures Coverage.py to measure only the code coverage of
kas itself. In addition, we add a note in the devguide how to create and
inspect the coverage data.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Felix Moessbauer 2023-05-06 08:50:35 +02:00 committed by Jan Kiszka
parent 2503ab39cd
commit 27cf5ea897
2 changed files with 16 additions and 0 deletions

4
.coveragerc Normal file
View File

@ -0,0 +1,4 @@
[run]
omit =
/usr/*
tests/*

View File

@ -32,6 +32,18 @@ When you need a proxy to access the internet, add::
to the call. to the call.
Measure code coverage
---------------------
To measure the code coverage of the unit tests, the ``pytest-cov`` package is
required. On Debian systems, this is provided in ``python3-pytest-cov``.
Once installed, run::
$ python3 -m pytest --cov --cov-report html
The coverage in HTML format can then be found in `htmlcov`.
Community Resources Community Resources
------------------- -------------------