Skip to content

Commit 5303b8a

Browse files
committed
Add coverage
Signed-off-by: Xabier Larrakoetxea <[email protected]>
1 parent 7b8d829 commit 5303b8a

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
vendor/
1+
vendor/
2+
.test_coverage.txt

Makefile

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

2-
UNIT_TEST_CMD := go test `go list ./... | grep -v test\/integration` -race
3-
INTEGRATION_TEST_CMD := go test ./test/integration -race -tags='integration'
4-
BENCHMARK_CMD := go test `go list ./... | grep -v vendor` -benchmem -bench=.
5-
CHECK_CMD = golangci-lint run -E goimports
6-
DEPS_CMD := go mod tidy
7-
MOCKS_CMD := go generate ./internal/mocks
2+
UNIT_TEST_CMD := go test `go list ./... | grep -v test\/integration` -race -coverprofile=.test_coverage.txt && \
3+
go tool cover -func=.test_coverage.txt | tail -n1 | awk '{print "Total test coverage: " $$3}'
4+
INTEGRATION_TEST_CMD := go test ./test/integration -race -tags='integration'
5+
BENCHMARK_CMD := go test `go list ./... | grep -v vendor` -benchmem -bench=.
6+
CHECK_CMD := golangci-lint run -E goimports
7+
DEPS_CMD := go mod tidy
8+
MOCKS_CMD := go generate ./internal/mocks
89

910
help: ## Show this help.
1011
@echo "Help"

0 commit comments

Comments
 (0)