Coverage badge sourced from downstream job displays "unknown"

I have set up a pipeline that generates some gitlab-ci configuration and than triggers all jobs defined in it. There are currently four jobs triggered and all run successfully:

Three of them provide coverage information which is correctly parsed and understood by the GitLab CI.

Nevertheless, all coverage badges that I configured constantly display “unkown”.

What am I missing here? Are the badge URLs wrong?

Hi @mpatzlaff

Is the downstream job in a different repo? Do you have Settings → CI/CD Settings → General pipelines → Test coverage parsing set correctly, and in the right place?

Hi @snim2

The downstream jobs are not physical in any repository - they are generated on-the-fly by the projects “generate-config” job and then triggered for execution (screenshot 1; see also Parent-child pipelines | GitLab). But still they all work on the same repository. The test coverage parsing is also working (screenshot 2). It makes no difference if the regular expression is configured through the setting you mentioned or through the “coverage” keyword in the job configurations or by both means. It is always correctly extracted by the CI but never shown in the badges.

Hmm. That sounds like it might be a bug. Have you checked the issues board?

Well that was a good hint. It seems, that I overlooked crucial information in the description of the ‘coverage’ keyword:

Additional details :

  • If there is more than one matched line in the job output, the last line is used.
  • Leading zeros are removed.
  • Coverage output from child pipelines is not recorded or displayed. Check the related issue for more details.

Too bad, but it seems I have to wait for this to eventually work. And most probably it will take time because the realisation seems complicated…

Oh, that’s annoying. I guess you could always write a script to parse the output yourself before it gets to the log, but that might be more trouble than it’s worth.