Code coverage improvements
With !89 (merged) support for code coverage reporting in our CI pipelines has been merged. We might want to improve that through following measures:
- For badge currently only an integer value is read in, not 3 significant digits like the HTMl report shows. For that run gcovr with
-s
flag and regex on thelines: X% (..)
output instead of on theTOTAL..
line like recommended by GitLab docs. Regex for-s
output:^lines:\s(\d+.*%)\s\(\d+\sout\sof\s\d+\)
. - Badge shows 4 significant digits. Can gcovr be more exact than 3 significant digits?
- Exclude autotests directories. Including them gives a nice quick check that no autotest accidentally isn't run, but the coverage ratio is pushed artificially.
- Add CI job that fails when the coverage decreases. This job should be set to
allow_failure: true
, so that it manifests only as a warning. Maybe only run on MRs. Guide on how to create such a job is here.
Edited by Roman Gilg