Problem to solve
Code coverage is not being set in one specific repo
I’m trying to get our code coverage to show up in Gitlab, for our main repo. We already have the coverage calculation in place, so this looked as easy as setting up the coverage
key and the proper regex. I double checked the regex with regex101 dot com.
Steps to reproduce
I couldn’t get it to work so I set out to create a new repo where it would be easier to test and understand how this is supposed to work. I got it running on the first try there. After much fussing around I ended up creating a new branch in our main repo, with the exact same .gitlab-ci.yml
file as my test repo, and still I don’t see code coverage in our main repo.
I searched and I didn’t find anything that could be turned off (in the main repo) to prevent this from running.
I guess you can’t really reproduce it without access to my main repo (which is private…)
Configuration
This is my .gitlab-ci.yml
which works in the test repo but not on the main one:
services:
- name: docker:24-dind
stages:
- test
Test:
stage: test
script:
- echo "Testing done"
Code coverage:
stage: test
script:
- echo "Final Coverage 123/200 (45.23%)"
coverage: '/^Final Coverage .*\((\d+.\d+)%\)/'
Sleep:
stage: test
script:
- sleep 60
Versions
We’re running self-hosted gitlab on the premium tier. Software version is 17.4
Runners are running 17.2.1