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

Commit 0f5dd8a

Browse files
committed
fix coverage issues
Be sure to remove the non needed lines. Signed-off-by: Yves Brissaud <[email protected]>
1 parent d0cc6fb commit 0f5dd8a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,12 @@ coverage-test-e2e: coverage-bin
9393
@echo "Running e2e tests (coverage)..."
9494
@$(call mkdir,_build/cov)
9595
@$(call mkdir,$(TEST_RESULTS_DIR))
96-
DOCKERAPP_BINARY=../e2e/coverage-bin $(call GO_TESTSUM,e2e-coverage.xml) -v ./e2e
96+
DOCKERAPP_BINARY=../e2e/coverage-bin $(call GO_TESTSUM,e2e-coverage.xml) -v ./e2e $(INCLUDE_E2E)
9797

9898
coverage: coverage-test-unit coverage-test-e2e ## run tests with coverage
99+
@echo "Fixing coverage files..."
100+
find _build/cov/ -type f -name "*.out" -print0 | xargs -0 sed -i '/^coverage/d'
101+
grep coverage _build/cov/*.out || true
99102
go install ./vendor/github.com/wadey/gocovmerge/
100103
gocovmerge _build/cov/*.out > _build/cov/all.out
101104
go tool cover -func _build/cov/all.out
@@ -131,7 +134,7 @@ schemas: specification/bindata.go ## generate specification/bindata.go from json
131134
help: ## this help
132135
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
133136

134-
.PHONY: cross e2e-cross test check lint test-unit test-e2e coverage coverage-bin coverage-test-unit coverage-test-e2e clean vendor schemas help
137+
.PHONY: cross e2e-cross test check lint test-unit test-e2e coverage coverage-bin coverage-test-unit coverage-test-e2e clean vendor schemas help fix-coverage
135138
.DEFAULT: all
136139

137140

e2e/coverage-bin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $BUILD_DIR/docker-app.cov \
99
-test.coverprofile=$BUILD_DIR/cov/$(uuidgen).out \
1010
"$@" \
1111
| grep -vE '^PASS$' \
12-
| grep -vE '^coverage: [0-9]+\.[0-9]+% of statements in .+$' \
12+
| grep -vE '^coverage:.*$' \
1313
| grep -v '^=== RUN TestRunMain$'
1414

1515
exit ${PIPESTATUS[0]}

0 commit comments

Comments
 (0)