In our mono repo, hosted on a GitLab server, we have multiple types of tests, e.g., for
that run in a CI/CD pipeline setup (GitLab is version v16.8.1).
For all these tests a Cobertura coverage XML report is created. The .gitlab-ci.yml
looks something like this:
test_c:
stage: test
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
script:
- ./test_script_c.sh
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: build/tests/c/CoberturaCoverageScripts.xml
test_python:
stage: test
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
script:
- ./test_script_python.sh
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: build/tests/python/CoberturaCoverageScripts.xml
test_java:
stage: test
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
script:
- ./test_script_java.sh
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: build/tests/java/CoberturaCoverageScripts.xml
This has now the downside, that
Especially on the MRs, this is quite bad. As I only know that the overall project test coverage is like that, but I would need to know that the most important coverage (e.g., C) has not gotten worse and is not catched by an improved test coverage in the e.g., Java part of the project.
Is there an option to have all three coverage reports shown on at least the MR, i.e., find a setup for the GitLab CI/CD pipeline that shows multiple test coverage numbers.
This is only a partial answer, but you can see the coverage results of different jobs when pointing the mouse on the ?
next to the coverage value in your MR. Here is an example screenshot from one of my projects:
Still I would be also happy to see a solution on how I can create separate badges for each job.