Skip to content

Commit

Permalink
Fix makefile ci target and coverage test packages (open-telemetry#1634)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias authored and ldelossa committed Mar 5, 2021
1 parent 5b85dd9 commit 0c9f6db
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 0c9f6db

Please sign in to comment.