vladopajic / go-test-coverage

go-test-coverage is tool and github action which reports issues when test coverage is below set threshold
GNU General Public License v3.0
81 stars 10 forks source link

feat: show actual coverage in the success output #99

Closed gemyago closed 5 days ago

gemyago commented 4 weeks ago

The current output will print the actual total test coverage and will not print the actual min file and min package thresholds. Sometimes it's useful to see how well your coverage is above and increase thresholds if it increases significantly.

Example of current output:

File coverage threshold (X%) satisfied:     PASS
Package coverage threshold (Y%) satisfied:  PASS
Total coverage threshold (90%) satisfied:   PASS
Total test coverage: 95%

Desired output:

File coverage threshold (X%) satisfied (aX%):       PASS
Package coverage threshold (Y%) satisfied (aY%):    PASS
Total coverage threshold (90%) satisfied:       PASS
Total test coverage: 95%

Where aX corresponds to the lowest file coverage and aY corresponds to the actual lowest package threshold.

vladopajic commented 2 weeks ago

hey @gemyago thanks for reporting issue

if project has a lot of files and packages output would get noisy, so adding it by default doesn't seem like right approach.

if someone is working on tests, or for any reason want to see if they can increase coverage thresholds, they can run check locally and manually tweak configuration. for example this project has make check-coverage command, which makes it vary convenient to tweak settings and run check to see if it passing.