Cobertura coverage report not showing in MR's diff

I have recently added the cobertura coverage report to my repository, but it still does not show the coverage in an MR’s diff.

Here is the job of my .gitlab-ci.yml that generates the coverage report:

coverage-report:
  stage: coverage
  script:
    - tox -e coverage-report
  coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
  artifacts:
    name: "coverage"
    paths:
      - public/coverage
    expire_in: 1 week
    reports:
      cobertura: public/coverage/coverage.xml
    expose_as: "coverage"

And here is my tox.ini:

[tox]
envlist =
    coverage-report
minversion = 3.4

[testenv:coverage-report]
basepython = python2.7-32
skip_install = True
deps =
  coverage
commands =
  coverage run -m pytest -s -vv -x --junitxml=public/test-report.xml tests/
  coverage report
  coverage html
  coverage xml

I am pretty sure everything goes well with the report because not only does its XML exist under public/coverage (which I can see through the published artifacts), but the coverage % summary also shows up in the job and MR. But the coverage still does not show up in the MR’s diff. I also tried opening the Network tab of my browser and look for the merge_requests/26/coverage_reports.json HTTP request, and that is coming up empty (more specifically, the response is {"files":{}}), which I do not think is supposed to be happening.

I am using Python 2.7-32 and Coverage.py to get the report. My GitLab is self-hosted with version 14.9.5-ee. Here is a link to download my coverage.xml. It is not the complete coverage, but it shows 2 files which show up in the MR’s diff but have no coverage information.

Hi,

you are using the deprecated version for code coverage with cobertura that will certainly fail if you update to 15.0. See: Deprecations by version > 15.0 > artifacts:reports:cobertura keyword

A bit strange is that the 14.10 docs say it was removed with 14.10. Maybe a documentation error.

But certainly if you update now you won’t have to think about this later. So why not give ot a try?
See artifacts:reports:coverage_report

This would be your new job definition if i did no mistake while copy&pasting.

coverage-report:
  stage: coverage
  script:
    - tox -e coverage-report
  coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
  artifacts:
    expose_as: "coverage"
    name: "coverage"
    expire_in: 1 week
    paths:
      - public/coverage
    reports:
      coverage_report:
        coverage_format: cobertura
        path: public/coverage/coverage.xml