Skip to content

"Test coverage visualization" does not work with simple Python project

Summary

I am trying to get the "Test coverage visualization" work with a simple Python project. Unfortunately, it does not seem to be working. Calculating total coverage percentage works fine though (badge is available).

Steps to reproduce

On example project (see link below):

  1. comment all the tests in main.py, commit
  2. uncomment all the tests in main.py, commit
  3. (unexpected) no coverage visualization on commit change (link)
  4. Same with merge, (unexpected) no coverage visualization on merge change (link)

Example Project

https://gitlab.com/mvfwd/gitlab-coverage

What is the current bug behavior?

I don't see anything that looks like code coverage on commit (or merge) change.

What is the expected correct behavior?

I expect to see green/red labels on every modified line of the change showing if this line was covered by tests.

Additionally (not sure if that's possible) I'd like to see line-by-line coverage on every file in project repo.

Relevant logs and/or screenshots

$ 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

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

(skipped)

Results of GitLab application Check

(skipped)

Possible fixes

No workaround or fixes found yet.

Edited by mvfwd