Arrays don't seem to be supported according to the documentation, but you can use a glob pattern.
artifacts:
reports:
cobertura: "**/build/cobertura.xml"
Answer from sytech on Stack OverflowGitLab
forum.gitlab.com › gitlab ci/cd
Multiple code coverage reports from one job - GitLab CI/CD - GitLab Forum
August 9, 2021 - I have a monorepo with several packages. Unit-tests and coverage are run separately for each of packages, but within one CI job. In the end I export multiple cobertura XML files from my job: artifacts: reports: cobertura: 'packages/{package1,package2}/coverage/cobertura-coverage.xml' But then ...
Stack Overflow
stackoverflow.com › questions › 77954640 › multiple-coverage-reports-and-badges-for-gitlab-tests
Multiple coverage reports and badges for GitLab Tests - Stack Overflow
The .gitlab-ci.yml looks something like this: Copytest_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
Test coverage report in MR merged from different jobs
Hello! In the doc https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualization.html it’s said You can specify one or more coverage reports to collect, including wildcard paths. GitLab then takes the coverage information in all the files and combines it together. More on forum.gitlab.com
Combined coverage for a repository
Combined test coverage for a repository (not in the context of an MR) I am aware of a feature in an MR which marks combined code coverage https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualizatio… More on forum.gitlab.com
Enabling cobertura
Following the docs, I’ve enabled the flag in the console: Feature.all.map {|f| [f.name, f.state]} => [["multiple_merge_request_assignees", :on], ["coverage_report_view", :on]] Looking at the job logs I have confirmed that the report xml is generated, and that it’s also specified in the ... More on forum.gitlab.com
Pipeline Cobertura coverage reports - clarification - GitLab CI/CD - GitLab Forum
self-hosted Omnilbus Docker 13.12.3 ... but I think I might know why…) that, per the page at how-test-coverage-visualization-works, multiple Cobertura formatted XML reports can be uploaded as is, and that Gitlab will properly aggregate them for display in the MR diffs ... More on forum.gitlab.com
Top answer 1 of 2
6
Arrays don't seem to be supported according to the documentation, but you can use a glob pattern.
artifacts:
reports:
cobertura: "**/build/cobertura.xml"
2 of 2
3
Thanks @sytech for the correct answer.
Gitlab 14.10 changed the config format for coverage reports: https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscoverage_report
This worked for me:
artifacts:
when: always
reports:
junit: junit.xml
coverage_report:
coverage_format: cobertura
path: packages/*/coverage/cobertura-coverage.xml
GitLab
forum.gitlab.com › gitlab ci/cd
Test coverage report in MR merged from different jobs - GitLab CI/CD - GitLab Forum
September 24, 2021 - In the doc https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualization.html it’s said You can specify one or more coverage reports to collect, including wildcard paths.
GitLab
docs.gitlab.com › gitlab docs › use gitlab › use ci/cd to build your application › testing › code coverage › coverage reporting
Coverage reporting | GitLab Docs
... Add the coverage keyword to your job with a regular expression that matches your test tool’s output: test: script: - pytest --cov coverage: '/TOTAL.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' To aggregate coverage from multiple jobs, add the coverage keyword to each job.
GitLab
docs.gitlab.com › gitlab docs › use gitlab › use ci/cd to build your application › ci/cd yaml syntax reference › artifacts reports
CI/CD artifacts reports types | GitLab Docs
artifacts: reports: coverage_report: coverage_format: cobertura path: coverage/cobertura-coverage.xml · You can generate multiple reports and collect them using wildcards.
GitLab
forum.gitlab.com › gitlab ci/cd
Combined coverage for a repository - GitLab CI/CD - GitLab Forum
June 28, 2021 - Combined test coverage for a repository (not in the context of an MR) I am aware of a feature in an MR which marks combined code coverage https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualization.html My repo does have multiple cobertura coverage reports being generated Do I have the ability to see the combined coverage for the repo outside the MR context, while I browse the repo on master branch?
GitLab
gitlab.com › gitlab.org › #367317
Improve aggregation of code coverage across jobs (#367317) · Issues · GitLab.org / GitLab · GitLab
July 8, 2022 - Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
GitLab
docs.gitlab.com › ee › ci › testing › test_coverage_visualization.html
Test coverage visualization
Sign in to GitLab · By signing in you accept the Terms of Use and acknowledge the Privacy Statement and Cookie Policy · Don't have an account yet? Register now · or sign in with · Remember me · Explore Help About GitLab GitLab community forum · English · 简体中文 · 日本語
Xahteiwi
xahteiwi.eu › resources › hints-and-kinks › coverage-gitlab-ci
xahteiwi.eu – Using coverage with multiple parallel GitLab CI jobs
March 10, 2019 - This instructs coverage to write its results not into one file, .coverage, but into multiple, named .coverage.<hostname>.<pid>.<randomnumber> — meaning you get separate results files for each coverage run. Subsequently, you can combine your coverage data with coverage combine, and then do whatever you like with the combined data (coverage report, coverage html, etc.). Now there’s a bit of a difficulty with GitLab CI, which is that your individual tox testenvs will all run in completely different container instances.
Aldec
aldec.com › support › resources › documentation › application notes › code coverage visualization in gitlab
Code Coverage Visualization in GitLab - Application Notes - Documentation - Resources - Support - Aldec
GitLab uses CI/CD's artifacts reports feature to collect the coverage information. You can specify one or more coverage report to collect, including wildcard paths. This change should be applied into the .yml file. For the coverage analysis to work, you have to provide a properly formatted ...
GitLab
forum.gitlab.com › gitlab ci/cd
Enabling cobertura - GitLab CI/CD - GitLab Forum
April 28, 2020 - Following the docs, I’ve enabled the flag in the console: Feature.all.map {|f| [f.name, f.state]} => [["multiple_merge_request_assignees", :on], ["coverage_report_view", :on]] Looking at the job logs I have confirmed that the report xml is generated, and that it’s also specified in the ...
GitLab
forum.gitlab.com › gitlab ci/cd
Pipeline Cobertura coverage reports - clarification - GitLab CI/CD - GitLab Forum
December 24, 2021 - self-hosted Omnilbus Docker 13.12.3 ... but I think I might know why…) that, per the page at how-test-coverage-visualization-works, multiple Cobertura formatted XML reports can be uploaded as is, and that Gitlab will properly aggregate them for display in the MR diffs ...
GitLab
docs.gitlab.com › gitlab docs › use gitlab › use ci/cd to build your application › testing › code coverage
Code coverage | GitLab Docs
Coverage reporting extracts a percentage from your test tool’s job log output. You define a regular expression in the coverage keyword.
GitHub
gist.github.com › rishitells › 3c4536131819cff4eba2c8ab5bbb4570
Setting up Jest tests and coverage in GitLab CI · GitHub
You can specify one or more coverage reports to collect, including wildcard paths. GitLab then takes the coverage information in all the files and combines it together.
GitLab
docs.gitlab.com › gitlab docs › use gitlab › use ci/cd to build your application › testing › code coverage › coverage visualization
Coverage visualization | GitLab Docs
test: script: - run tests with coverage artifacts: reports: coverage_report: coverage_format: cobertura # or jacoco path: coverage/coverage.xml ... To collect multiple reports, use a wildcard in the artifact path.