diff --git a/.gitignore b/.gitignore index 4be608e597..a2804f629e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,9 @@ bin # Test binary, build with `go test -c` *.test -# Output of the go coverage tool, specifically when used with LiteIDE +# Output of the go coverage tool *.out +coverage.html # Vagrant .vagrant diff --git a/Makefile b/Makefile index b366dc51de..21e0fc1071 100644 --- a/Makefile +++ b/Makefile @@ -76,6 +76,13 @@ clean: test: go test -v -race ./cmd/... ./pkg/... +.PHONY: test/coverage +test/coverage: + go test -v -race -coverprofile=cover.out ./cmd/... ./pkg/... + grep -v "mock" cover.out > filtered_cover.out + go tool cover -html=filtered_cover.out -o coverage.html + rm cover.out filtered_cover.out + .PHONY: test-sanity test-sanity: go test -v -race ./tests/sanity/...