This repository was archived by the owner on Jul 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -81,17 +81,21 @@ unit-test:
81
81
@echo " Running unit tests..."
82
82
$(GO_TEST ) $(shell go list ./... | grep -vE '/e2e')
83
83
84
- clean :
85
- rm -Rf ./_build docker-app-* .tar.gz
86
-
87
84
coverage-bin :
88
85
$(GO_TEST ) -coverpkg=" ./..." -c -tags testrunmain -o _build/$(BIN_NAME ) .cov
86
+ go install ./vendor/github.com/wadey/gocovmerge/
89
87
90
88
coverage : coverage-bin
89
+ @echo " Running e2e tests (coverage)..."
91
90
DOCKERAPP_BINARY=../codecoverage/coverage-bin $(GO_TEST ) -v ./e2e
91
+ @echo " Running unit tests (coverage)..."
92
92
$(GO_TEST ) -cover -test.coverprofile=codecoverage/unit.out $(shell go list ./... | grep -vE '/vendor/|/e2e')
93
93
gocovmerge codecoverage/* .out > codecoverage/all.out
94
94
go tool cover -func codecoverage/all.out
95
+ go tool cover -html codecoverage/all.out -o codecoverage/coverage.html
96
+
97
+ clean :
98
+ rm -Rf ./_build docker-app-* .tar.gz codecoverage/* .out codecoverage/* .html
95
99
96
100
# #########################
97
101
# Continuous Integration #
@@ -116,5 +120,5 @@ ci-gradle-test:
116
120
-e GRADLE_USER_HOME=/tmp/gradle \
117
121
gradle:jdk8 bash -c " cd /gradle && gradle --stacktrace build && cd example && gradle renderIt"
118
122
119
- .PHONY : bin bin-all test check lint e2e-test e2e-all unit-test clean ci-lint ci-test ci-bin-all ci-e2e-all ci-gradle-test
123
+ .PHONY : bin bin-all release test check lint test-cov e2e-test e2e-all unit-test coverage coverage-bin clean ci-lint ci-test ci-bin-all ci-e2e-all ci-gradle-test
120
124
.DEFAULT : all
Original file line number Diff line number Diff line change 3
3
# This script is a proxy that injects the required test flags and strips out test output
4
4
# It allows us to use a coverage-enabled binary for e2e tests
5
5
6
- ../_build/docker-app.cov $* -test.v -test.coverprofile=../codecoverage/e2e.out | \
7
- grep -vE ' ^PASS$' | grep -vE ' ^coverage: [0-9]+\.[0-9]+% of statements in .+$' | grep -v ' ^=== RUN TestRunMain$'
6
+ ../_build/docker-app.cov \
7
+ $* \
8
+ -test.coverprofile=../codecoverage/$( uuidgen) .out \
9
+ -test.v \
10
+ | grep -vE ' ^PASS$' \
11
+ | grep -vE ' ^coverage: [0-9]+\.[0-9]+% of statements in .+$' \
12
+ | grep -v ' ^=== RUN TestRunMain$'
You can’t perform that action at this time.
0 commit comments