From a6cc155fabbeddca22c7ff32195731215ca288d5 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Wed, 3 Mar 2021 10:12:14 -0800 Subject: [PATCH] Fix makefile ci target and coverage test packages --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index fa11b5613fc..46a44b5f6e3 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ TIMEOUT = 60 .PHONY: precommit ci precommit: dependabot-check license-check lint build examples test-default -ci: precommit check-clean-work-tree test-with-coverage +ci: precommit check-clean-work-tree test-coverage # Tools @@ -114,9 +114,11 @@ test-coverage: for dir in $(ALL_COVERAGE_MOD_DIRS); do \ echo "$(GO) test -coverpkg=./... -covermode=$(COVERAGE_MODE) -coverprofile="$(COVERAGE_PROFILE)" $${dir}/..."; \ (cd "$${dir}" && \ - $(GO) test -coverpkg=./... -covermode=$(COVERAGE_MODE) -coverprofile="$(COVERAGE_PROFILE)" ./... && \ - $(GO) tool cover -html=coverage.out -o coverage.html); \ - [ -f "$${dir}/coverage.out" ] && cat "$${dir}/coverage.out" >> coverage.txt; \ + $(GO) list ./... \ + | grep -v third_party \ + | xargs $(GO) test -coverpkg=./... -covermode=$(COVERAGE_MODE) -coverprofile="$(COVERAGE_PROFILE)" && \ + $(GO) tool cover -html=coverage.out -o coverage.html); \ + [ -f "$${dir}/coverage.out" ] && cat "$${dir}/coverage.out" >> coverage.txt; \ done; \ sed -i.bak -e '2,$$ { /^mode: /d; }' coverage.txt