I have successfully generated a Cobertura format xml for my coverage that stores in tests/_output/cobertura.xml. And I can also see my artifacts setting work there:
@yookoala Thanks for the post and welcome to the forum!
I’m glad to see you got the text coverage visualization working!
To get the badge working you still need to setup parsing for the coverage value from the logs as described here in the documentation. Looking at your latest Merge Request adding ^\s*Lines:\s*\d+.\d+\% should work and then the badge will start to work once a pipeline has completed.
OK, I found it, and it works, but here’s some feedback:
It’s quite confusing that you need to change two different sections of the job configuration to enable the code coverage features of GitLab. Some features are enabled by the coverage attribute and the corresponding regex, and others are enabled by the coverage report under artifacts.
It also doesn’t make a lot of sense that only one format (Cobertura) is supported for the report and multiple are supported for the regex.
Hi,
All links mentioned above have been moved not sure why. Can someone please help me understand what else I need to do to show up code coverage in pipeline as well as at project level. My unit test job is shared below
I have gone through this youtube video and tried finding these settings in gitlab but can’t find ci/cd pipeline settinsg to add code coverage parsing. Could you please point me to docs with instructions
Pipeline view:
settings → ci/cd → general pipelines(Expand) → scroll down to ‘Test coverage parsing’
FTR. It is resolved. I didnt need to make any changes except adding badge in general settings.
Mistake was incorrect regex in job config.
I had added TOTAL(capital case) in regex which was not matching job output. After fixing regex to below fixed the issue.