在我们托管在 GitLab 服务器上的 Mono 存储库中,我们有多种类型的测试,例如,
在 CI/CD 管道设置中运行(GitLab 版本为 v16.8.1)。
对于所有这些测试,都会创建 Cobertura 覆盖率 XML 报告。
.gitlab-ci.yml
看起来像这样:
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
现在有一个缺点,那就是
尤其是对于MR来说,这是非常糟糕的。因为我只知道整个项目的测试覆盖率是这样的,但我需要知道最重要的覆盖率(例如,C)并没有变得更糟,并且没有被改进的测试覆盖率所捕获,例如,Java 部分项目。
是否可以选择至少在 MR 上显示所有三个覆盖率报告,即找到显示多个测试覆盖率数字的 GitLab CI/CD 管道设置。