Hey,
I am trying to make test coverage work for a python project. And I simply cannot figure out why there is no percentage showing neither in the tests nor the badge.
The command coverage report
is called produces this output in the log:
[...]
tests/__init__.py 0 0 100%
tests/test_ml_squarer.py 4 0 100%
tests/test_squarer.py 4 0 100%
----------------------------------------------
TOTAL 17 2 88%
test_service run-test: commands[4] | coverage xml
and depending on the regex
-expression that is saved in General > CI/CD, it simply looks for the 88%
next to TOTAL
. I used the recommend for pytest-cov (Python) , i.e. ^TOTAL.+?(\d+\%)$
which should work according to a regex checker.
I also run coverage xml
together with
artifacts:
reports:
cobertura: coverage.xml
which results in a successful upload:
Uploading artifacts...
Runtime platform arch=amd64 os=linux pid=29421 revision=05161b14 version=12.4.1
coverage.xml: found 1 matching files
Uploading artifacts to coordinator... ok id=8996 responseStatus=201 Created token=DXpxsGiF
However, it is not working for me using: GitLab Community Edition 12.10.11. Any ideas anyone?