Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test coverage to >= 80% #21

Open
wagoodman opened this issue Jun 3, 2020 · 2 comments
Open

Improve test coverage to >= 80% #21

wagoodman opened this issue Jun 3, 2020 · 2 comments

Comments

@wagoodman
Copy link
Contributor

wagoodman commented Jun 3, 2020

Once coverage is at a good threshold, add a quality gate to the pipeline to prevent regression of coverage below a threshold.

@jonasagx
Copy link
Contributor

jonasagx commented Nov 3, 2021

Via

$ go test ./... -coverprofile=c.out
$ go tool cover -func c.out

As of today the total coverage is at 48.8%

@wagoodman
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants