gotestyourself / gotestyourself/gotestsum

generate coverage reports

Open
#335 2 comments 11 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
2.7k
Forks
171
PR merge metrics
No merged PRs in 30d

Description

[@dnephin commented in @302](https://github.com/gotestyourself/gotestsum/issues/302#issuecomment-1513993027) in a discussion about coverage output:
> go tool cover (https://pkg.go.dev/cmd/cover) is a similar idea. It can produce 2 reports: coverage percentage per function, and a detailed HTML report. The HTML report effectively has this information, but it's not presented this way.
>
> It seems like it wouldn't be too difficult to copy and modify https://cs.opensource.google/go/go/+/refs/tags/go1.20.3:src/cmd/cover/html.go to make a new report in the format you want. It is possible there is a tool out there that has already done the work, I haven't looked. If you want to build it, it could work as gotestsum tool cover-report or something similar. A [new issue](https://github.com/gotestyourself/gotestsum/issues/new) for this would be great.

I use coverage reporting in CI, and [GitLab's coverage visualization](https://docs.gitlab.com/ee/ci/testing/test_coverage_visualization.html) requires cobertura format. I'm currently using [gocover-cobertura](github.com/boumenot/gocover-cobertura) to generate this report. It would be handy to be able to generate both the junit and cobertura reports from gotestsum all at once -- possibly alongside the html output that was mentioned in the comment that dnephin was replying to.

Contributor guide

No contributing guide indexed for this repository

Research direction

Review gotestsum's existing JUnit reporting path and the Go cmd/cover/html.go reference mentioned in the issue. Compare the requested Cobertura output with gocover-cobertura and GitLab's coverage visualization requirements. Done means gotestsum can generate JUnit and Cobertura reports together, with the scope of HTML output clarified.

Written by the indexing model from the issue text.

Assessment

Tech stack
gitlab, go
Domain
ci-cd, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.