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:
8181 @echo " Running unit tests..."
8282 $(GO_TEST ) $(shell go list ./... | grep -vE '/e2e')
8383
84- clean :
85- rm -Rf ./_build docker-app-* .tar.gz
86-
8784coverage-bin :
8885 $(GO_TEST ) -coverpkg=" ./..." -c -tags testrunmain -o _build/$(BIN_NAME ) .cov
86+ go install ./vendor/github.com/wadey/gocovmerge/
8987
9088coverage : coverage-bin
89+ @echo " Running e2e tests (coverage)..."
9190 DOCKERAPP_BINARY=../codecoverage/coverage-bin $(GO_TEST ) -v ./e2e
91+ @echo " Running unit tests (coverage)..."
9292 $(GO_TEST ) -cover -test.coverprofile=codecoverage/unit.out $(shell go list ./... | grep -vE '/vendor/|/e2e')
9393 gocovmerge codecoverage/* .out > codecoverage/all.out
9494 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
9599
96100# #########################
97101# Continuous Integration #
@@ -116,5 +120,5 @@ ci-gradle-test:
116120 -e GRADLE_USER_HOME=/tmp/gradle \
117121 gradle:jdk8 bash -c " cd /gradle && gradle --stacktrace build && cd example && gradle renderIt"
118122
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
120124.DEFAULT : all
Original file line number Diff line number Diff line change 33# This script is a proxy that injects the required test flags and strips out test output
44# It allows us to use a coverage-enabled binary for e2e tests
55
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