Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Commit

Permalink
fix coverage issues
Browse files Browse the repository at this point in the history
Be sure to remove the non needed lines.

Signed-off-by: Yves Brissaud <[email protected]>
  • Loading branch information
eunomie committed Nov 7, 2019
1 parent d0cc6fb commit 038e57d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ coverage-test-e2e: coverage-bin
@echo "Running e2e tests (coverage)..."
@$(call mkdir,_build/cov)
@$(call mkdir,$(TEST_RESULTS_DIR))
DOCKERAPP_BINARY=../e2e/coverage-bin $(call GO_TESTSUM,e2e-coverage.xml) -v ./e2e
DOCKERAPP_BINARY=../e2e/coverage-bin $(call GO_TESTSUM,e2e-coverage.xml) -v ./e2e $(INCLUDE_E2E)

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

.PHONY: cross e2e-cross test check lint test-unit test-e2e coverage coverage-bin coverage-test-unit coverage-test-e2e clean vendor schemas help
.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
.DEFAULT: all


Expand Down
2 changes: 1 addition & 1 deletion e2e/coverage-bin
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $BUILD_DIR/docker-app.cov \
-test.coverprofile=$BUILD_DIR/cov/$(uuidgen).out \
"$@" \
| grep -vE '^PASS$' \
| grep -vE '^coverage: [0-9]+\.[0-9]+% of statements in .+$' \
| grep -vE '^coverage:.*$' \
| grep -v '^=== RUN TestRunMain$'

exit ${PIPESTATUS[0]}

0 comments on commit 038e57d

Please sign in to comment.