lcov-to-cobertura-xml
lcov-to-cobertura-xml copied to clipboard
gitlab-ci can't read .xml file, which is conversion by lcov-to-cobertura-xml
I have a .lcov file generated by llvm-cov.
/usr/lib/llvm-8/bin/llvm-cov export -format=lcov -Xdemangler c++filt -Xdemangler -n -instr-profile=xxx.profdata -object=build/bin/xxx > worker_ut.lcov
python3 /usr/local/lib/python3.9/dist-packages/lcov_cobertura/lcov_cobertura.py xxxx.lcov
When i use it in gitlab-ci:
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
expire_in: 1 days
reports:
cobertura: xxx.xml
junit: xxxx.xml
But it doesn't work, Test is always 0
Are you sure that is the right CI configuration for your GitLab version? A while ago they changed that from what you have to this: https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscoverage_report
The coverage with regex feature is completely removed in current versions.
@egfx-notifications the regex feature is still there: https://docs.gitlab.com/ee/ci/yaml/#coverage (I'm using it in gitlab-cloud as we speak)
@EAHITechnology this is the gitlab-ci-config (snippet) that i currently use which works:
test:
script:
- myscript
coverage: '/Code coverage: \d+\.\d+/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: .reports/coverage.xml
Please forgive my faulty memory, the coverage regex in the CI configuration is indeed the replacement for the removed coverage regex in project settings. Somehow got that mixed up. Thank you for correcting me @betaboon