Skip to content

Option for comparing coverage reports #92

@lucavallin

Description

@lucavallin

At this moment, tparse shows the current coverage percentage. It would be useful to show, next to the current percentage, the difference with another given test report, for example one containing the coverage information for the main branch.

I am thinking of something like:

go test -json -cover -v ./... | tparse -all -format-markdown -compare=main-coverage.json

Which results in a table like:

STATUS ELAPSED PACKAGE COVER PASS FAIL SKIP
🟢 PASS 0.02s github.com/user/package1 100.0% (+20.3%) 3 0 0
🟢 PASS 1.16s github.com/user/package2 35.2% (-3.2%) 1 0 0
🟢 PASS 0.20s github.com/user/package3 70.5% (-) 4 1 0
🟢 PASS 0.78s github.com/user/package4 83.0% (+13.8%) 6 2 0
🟢 PASS 0.25s github.com/user/package5 48.8% (-) 2 0 1

This would make it easy and quick to see if a pull request is increasing or decreasing a project's test coverage.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions