-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Labels
Description
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.
danwkennedy