1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-03-31 21:55:32 +02:00

exclude example dirs from coverage test/report. (#365)

This commit is contained in:
rghetia 2019-12-02 23:58:53 -08:00 committed by GitHub
parent eb9fe13a77
commit f0eb35b918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

2
.gitignore vendored
View File

@ -6,6 +6,8 @@
coverage.*
/example/basic/basic
example/grpc/client/client
example/grpc/server/server
/example/http/client/client
/example/http/server/server
/example/http-stackdriver/client/client

View File

@ -4,6 +4,7 @@ EXAMPLES := $(shell ./get_main_pkgs.sh ./example)
ALL_DOCS := $(shell find . -name '*.md' -type f | sort)
# All directories with go.mod files. Used in go mod tidy.
ALL_GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort)
ALL_COVERAGE_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | egrep -v '^./example' | sort)
GOTEST_MIN = go test -v -timeout 30s
GOTEST = $(GOTEST_MIN) -race
@ -28,7 +29,7 @@ precommit: lint generate build examples test
.PHONY: test-with-coverage
test-with-coverage:
set -e; for dir in $(ALL_GO_MOD_DIRS); do \
set -e; for dir in $(ALL_COVERAGE_MOD_DIRS); do \
echo "go test ./... + coverage in $${dir}"; \
(cd "$${dir}" && \
$(GOTEST_WITH_COVERAGE) ./... && \