File tree 3 files changed +15
-4
lines changed
3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# GoLand IDEA
4
4
/.idea /
5
+ * .iml
5
6
6
7
# VS Code
7
8
.vscode
Original file line number Diff line number Diff line change @@ -29,9 +29,12 @@ test-with-cover:
29
29
@echo Verifying that all packages have test files to count in coverage
30
30
@scripts/check-test-files.sh $(subst github.com/open-telemetry/opentelemetry-collector-contrib/,./,$(ALL_PKGS ) )
31
31
@echo pre-compiling tests
32
- go test -i $(ALL_PKGS )
33
- $(GOTEST ) $(GOTEST_OPT_WITH_COVERAGE ) $(ALL_PKGS )
34
- go tool cover -html=coverage.txt -o coverage.html
32
+ set -e; for dir in $( ALL_TEST_DIRS) ; do \
33
+ echo " go test ./... + coverage in $$ {dir}" ; \
34
+ (cd " $$ {dir}" && \
35
+ $(GOTEST ) $(GOTEST_OPT_WITH_COVERAGE ) ./... && \
36
+ go tool cover -html=coverage.txt -o coverage.html ); \
37
+ done
35
38
36
39
.PHONY : install-tools
37
40
install-tools :
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ ALL_SRC_AND_DOC := $(shell find . \( -name "*.md" -o -name "*.go" -o -name "*.ya
7
7
8
8
# ALL_PKGS is used with 'go cover'
9
9
ALL_PKGS := $(shell go list $(sort $(dir $(ALL_SRC))))
10
+ # ALL_TEST_DIRS includes ./* dirs (excludes . dir)
11
+ ALL_TEST_DIRS := $(shell find . -type f -name "go.mod" -exec dirname {} \; | sort | egrep '^./' )
10
12
11
13
GOTEST_OPT?= -race -timeout 30s
12
14
GOTEST_OPT_WITH_COVERAGE = $(GOTEST_OPT) -coverprofile=coverage.txt -covermode=atomic
@@ -35,7 +37,12 @@ common: addlicense fmt impi vet lint goimports misspell staticcheck test
35
37
36
38
.PHONY: test
37
39
test:
38
- $(GOTEST) $(GOTEST_OPT) $(ALL_PKGS)
40
+ # $(GOTEST) $(GOTEST_OPT) $(ALL_TEST_DIRS)
41
+ set -e; for dir in $(ALL_TEST_DIRS); do \
42
+ echo "go test ./... in $${dir}"; \
43
+ (cd "$${dir}" && \
44
+ $(GOTEST) ./... ); \
45
+ done
39
46
40
47
.PHONY: benchmark
41
48
benchmark:
You can’t perform that action at this time.
0 commit comments