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

Commit 4a88b13

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

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
@@ -80,17 +80,21 @@ unit-test:
8080
@echo "Running unit tests..."
8181
$(GO_TEST) $(shell go list ./... | grep -vE '/vendor/|/e2e')
8282

83-
clean:
84-
rm -Rf ./_build docker-app-*.tar.gz
85-
8683
coverage-bin:
8784
$(GO_TEST) -coverpkg="./..." -c -tags testrunmain -o _build/$(BIN_NAME).cov
85+
go install ./vendor/github.com/wadey/gocovmerge/
8886

8987
coverage: coverage-bin
88+
@echo "Running e2e tests (coverage)..."
9089
DOCKERAPP_BINARY=../codecoverage/coverage-bin $(GO_TEST) -v ./e2e
90+
@echo "Running unit tests (coverage)..."
9191
$(GO_TEST) -cover -test.coverprofile=codecoverage/unit.out $(shell go list ./... | grep -vE '/vendor/|/e2e')
9292
gocovmerge codecoverage/*.out > codecoverage/all.out
9393
go tool cover -func codecoverage/all.out
94+
go tool cover -html codecoverage/all.out -o codecoverage/coverage.html
95+
96+
clean:
97+
rm -Rf ./_build docker-app-*.tar.gz codecoverage/*.out codecoverage/*.html
9498

9599
##########################
96100
# Continuous Integration #
@@ -110,5 +114,5 @@ ci-bin-all:
110114
$(foreach OS, $(OS_LIST), docker run --rm $(IMAGE_NAME)-bin-all:$(TAG) tar -cz -C $(PKG_PATH)/_build $(BIN_NAME)-$(OS)$(if $(filter windows, $(OS)),.exe,) > $(BIN_NAME)-$(OS)-$(TAG).tar.gz || exit 1;)
111115
$(foreach OS, $(OS_LIST), docker run --rm $(IMAGE_NAME)-bin-all:$(TAG) /bin/sh -c "cp $(PKG_PATH)/_build/*-$(OS)* $(PKG_PATH)/e2e && cd $(PKG_PATH)/e2e && tar -cz * --exclude=*.go" > $(E2E_NAME)-$(OS)-$(TAG).tar.gz || exit 1;)
112116

113-
.PHONY: bin bin-all release test check lint e2e-test e2e-all unit-test clean ci-lint ci-test ci-bin-all ci-e2e-all
117+
.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
114118
.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)