Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit eb11e4e

Browse files
committed
Scripts cleanup
Signed-off-by: Joffrey F <[email protected]>
1 parent eff17e7 commit eb11e4e

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff 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-
8784
coverage-bin:
8885
$(GO_TEST) -coverpkg="./..." -c -tags testrunmain -o _build/$(BIN_NAME).cov
86+
go install ./vendor/github.com/wadey/gocovmerge/
8987

9088
coverage: 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

codecoverage/coverage-bin

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
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$'

0 commit comments

Comments
 (0)