Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No coverage report in gitlab despite valid regex and activated parsing

So I have a netstandard library with a test project, nothing too large. This gets built and tested by Gitlab CI via dotnet test and coverlet. Part of the test's output will be this coverage report:

+---------+--------+--------+--------+
|         | Line   | Branch | Method |
+---------+--------+--------+--------+
| Total   | 90.87% | 67.66% | 94.32% |
+---------+--------+--------+--------+
| Average | 90.87% | 67.66% | 94.32% |
+---------+--------+--------+--------+

Now Gitlab uses regex to parse that, so naturally I have this regex parsing the first value:

Total\s*\|\s*(\d+\.\d+)%

I put it in in the coverage parsing setting under settings > general pipelines, and also added coverage: /Total\s*\|\s*(\d+\.\d+)%/ to the job in the .gitlab-ci.yml. I validated the regex using rubular, as Gitlab suggested: https://rubular.com/r/LOazRNRFmChzIr and it confirms my regex will find that coverage amount.

And yet, there is no coverage to be seen anywhere. The badge I added to the project also shows "coverage: unknown".

Is something still missing?

like image 936
Squirrelkiller Avatar asked Jan 31 '26 19:01

Squirrelkiller


1 Answers

Alright time to make myself look stupid.

I copypasted the table from my local machine's output into rubular.

Turns out the test runner uses commas a decimal separators, while my local machine uses periods. That is all.

like image 82
Squirrelkiller Avatar answered Feb 02 '26 07:02

Squirrelkiller