Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.
This repository was archived by the owner on Nov 25, 2024. It is now read-only.

Fix coverage reporting in Gitlab CI #248

@floric

Description

@floric

What happened?

In Gitlab CI coverage reports can be shown in merge requests. But this needs valid cobertura files. Unfortunately this project uses an outdated library with some issues including the wrong value for filenames. That's why the report is not shown in Gitlab.

How can we reproduce it?

Create coverage xml file and provide as cobertura artifact in Gitlab job. The resulting MR won't have any hit/miss markes (green/red lines).

What environment did it happen in?

Gitlab 16.2, newest version of this project

Possible Solution

Simply use fork https://github.com/boumenot/gocover-cobertura with correct filename attribute.

I could provide an MR but unfortunately it seems like this repo is not maintained properly right now. :(

As a workaround we can use the following in Gitlab for alpine based images:

sed -i.bak 's@'"$CI_SERVER_HOST/$CI_PROJECT_PATH/"'@@g' coverage.xml

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions