GitLab 测试覆盖率可视化不适用于简单示例

标签 gitlab gitlab-ci code-coverage

我创建了一个非常简单的例子:https://gitlab.com/mvfwd/gitlab-coverage .
不幸的是 gitlab 没有显示 Cobertura 覆盖可视化。
这是我的 .gitlab-ci.yml :

image: python:3

stages:
- test

coverage:
  stage: test
  script:
  - pip install coverage
  - coverage run ./main.py
  - coverage report -m
  - coverage xml
  artifacts:
    paths:
    - ./coverage.xml
    reports:
      cobertura: ./coverage.xml
  only:
  - master
在日志中,我可以看到覆盖率报告已上传( link ):
$ coverage run ./main.py
..
----------------------------------------------------------------------
Ran 2 tests in 0.001s
OK
$ coverage report -m
Name      Stmts   Miss  Cover   Missing
---------------------------------------
main.py      26     12    54%   9-14, 20-25
---------------------------------------
TOTAL        26     12    54%
$ coverage xml
Uploading artifacts for successful job
00:03
Uploading artifacts...
./coverage.xml: found 1 matching files and directories 
Uploading artifacts as "archive" to coordinator... ok  id=1450561054 responseStatus=201 Created token=eZqc9KYb
Uploading artifacts...
./coverage.xml: found 1 matching files and directories 
Uploading artifacts as "cobertura" to coordinator... ok  id=1450561054 responseStatus=201 Created token=eZqc9KYb
Cleaning up file based variables
00:00
Job succeeded
我究竟做错了什么?

最佳答案

我查看了您创建的示例项目。
当看 the diff for the open MR ,我能够看到覆盖率可视化。这是coverage visualization in sample project MR的截图.
如果您仍然遇到问题,如果您可以打开 bug report 那就太好了。并分享有关您的浏览器设置等的更多详细信息,以便我们确定您的问题的原因。

关于GitLab 测试覆盖率可视化不适用于简单示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68520813/

相关文章:

docker - 具有 GCP 凭据的 Gitlab Runner 镜像

javascript - Istanbul 尔:使用 mocha 生成代码 cobertura 报告

node.js - 没有为使用 nyc 的 vscode 扩展生成覆盖信息

Gitlab 管道失败 : ERROR: Preparation failed: Error response from daemon: toomanyrequests

ssl - 带有apache连接的gitlab被拒绝

git - pull/推到 Gitlab 错误部署正在进行中

gitlab -/bin/sh : eval: line 98: bash: not found

ruby-on-rails - Gitlab.com CI 中的 Rails 主 key

linux - 如何从 .gitlab-ci.yml 设置 DOCKER_BUILDKIT=1?

android - 使用 Sonar 和 Gradle 在 Android Studio 中实现代码覆盖率