stereoscope
stereoscope copied to clipboard
Improve test coverage to >= 80%
Once coverage is at a good threshold, add a quality gate to the pipeline to prevent regression of coverage below a threshold.
Via
$ go test ./... -coverprofile=c.out
$ go tool cover -func c.out
As of today the total coverage is at 48.8%
Thanks @jonasagx --also, the Makefile has the unit tests asserting minimal coverage (right now the quality gate threshold is 45%):
❯ make unit
Running unit tests
go test --race -coverprofile test/results/unit-coverage-details.txt github.com/anchore/stereoscope github.com/anchore/stereoscope/examples github.com/anchore/stereoscope/internal github.com/anchore/stereoscope/internal/bus github.com/anchore/stereoscope/internal/docker github.com/anchore/stereoscope/internal/log github.com/anchore/stereoscope/pkg/event github.com/anchore/stereoscope/pkg/event/parsers github.com/anchore/stereoscope/pkg/file github.com/anchore/stereoscope/pkg/filetree github.com/anchore/stereoscope/pkg/filetree/filenode github.com/anchore/stereoscope/pkg/image github.com/anchore/stereoscope/pkg/image/docker github.com/anchore/stereoscope/pkg/image/oci github.com/anchore/stereoscope/pkg/imagetest github.com/anchore/stereoscope/pkg/logger github.com/anchore/stereoscope/pkg/tree github.com/anchore/stereoscope/pkg/tree/node
? github.com/anchore/stereoscope [no test files]
? github.com/anchore/stereoscope/examples [no test files]
...
ok github.com/anchore/stereoscope/pkg/tree 0.369s coverage: 67.9% of statements
? github.com/anchore/stereoscope/pkg/tree/node [no test files]
Coverage: 48.8