mfridman / tparse

CLI tool for summarizing go test output. Pipe friendly. CI/CD friendly.
MIT License
948 stars 22 forks source link

Add minimum coder coverage conditions #120

Closed jc21 closed 2 months ago

jc21 commented 2 months ago

Hi, great tool I use it for all my projects.

It would be awesome if I could fail the report if the code coverage didn't hit minimum percentages. This could be a per-package percentage, where everything must hit a minimum and/or a overall minimum. Being able to specify one or the other as arguments would be nice.

eg:

go test -json -cover ./... | tparse -min-total-coverage 80
go test -json -cover ./... | tparse -min-package-coverage 80

I could do this with other tools but I'd like to avoid it where possible. :)

jc21 commented 2 months ago

Let me know if this is a direction you might want to go in, I could try to find some time to get a PR together

ccoVeille commented 2 months ago

I think it would be out of project scope.

By out of scope I mean that adding this would lead people to request more features, so it requires to maintain them.

Anyway, that's only my point of view, I will let owner reply.

Meanwhile you can use this tool, that should work easily with tparse and GitHub action

https://github.com/vladopajic/go-test-coverage

jc21 commented 2 months ago

Thanks I've implemented that instead.