Output coverage to Cobertura report
What does this MR do?
- Enables coverage in the
unit test
job - Installs
github.com/t-yuki/gocover-cobertura
and uses it to convert the coverage reports to a Cobertura XML report - Uploads the XML report as a
cobertura
artifact.
Notes:
- The first commit (ec1db755) is not supposed to be merged, it is only there to make this MR exemplify how the inline coverage would show up in an MR.
- the GitLab app has issues interpreting the report generated by
gocover-cobertura
as-is, namely:it cannot interpret more than 1<source>
nodes.- it needs to have either absolute or relative paths in
filename
attributes, instead of prefixed with the package name.
Why was this MR needed?
See #25350 (closed)
What's the best way to test this MR?
- Check for inline coverage indicators once the
coverage_report_view
feature is enabled on GitLab.com. - Check that !2252 (merged).json shows a JSON file containing data related to the 2 Go files changed.
What are the relevant issue numbers?
Closes #25350 (closed)
Edited by Pedro Pombeiro