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:
parent
eb9fe13a77
commit
f0eb35b918
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,6 +6,8 @@
|
|||||||
coverage.*
|
coverage.*
|
||||||
|
|
||||||
/example/basic/basic
|
/example/basic/basic
|
||||||
|
example/grpc/client/client
|
||||||
|
example/grpc/server/server
|
||||||
/example/http/client/client
|
/example/http/client/client
|
||||||
/example/http/server/server
|
/example/http/server/server
|
||||||
/example/http-stackdriver/client/client
|
/example/http-stackdriver/client/client
|
||||||
|
3
Makefile
3
Makefile
@ -4,6 +4,7 @@ EXAMPLES := $(shell ./get_main_pkgs.sh ./example)
|
|||||||
ALL_DOCS := $(shell find . -name '*.md' -type f | sort)
|
ALL_DOCS := $(shell find . -name '*.md' -type f | sort)
|
||||||
# All directories with go.mod files. Used in go mod tidy.
|
# 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_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_MIN = go test -v -timeout 30s
|
||||||
GOTEST = $(GOTEST_MIN) -race
|
GOTEST = $(GOTEST_MIN) -race
|
||||||
@ -28,7 +29,7 @@ precommit: lint generate build examples test
|
|||||||
|
|
||||||
.PHONY: test-with-coverage
|
.PHONY: test-with-coverage
|
||||||
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}"; \
|
echo "go test ./... + coverage in $${dir}"; \
|
||||||
(cd "$${dir}" && \
|
(cd "$${dir}" && \
|
||||||
$(GOTEST_WITH_COVERAGE) ./... && \
|
$(GOTEST_WITH_COVERAGE) ./... && \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user