chore: run tests in all packages

This commit is contained in:
Vladimir Mihailenco 2023-01-30 09:52:13 +02:00
parent 98a8502d8e
commit ddb0bc08be
1 changed files with 11 additions and 7 deletions

View File

@ -1,11 +1,15 @@
PACKAGE_DIRS := $(shell find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | sort) GO_MOD_DIRS := $(shell find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | sort)
test: testdeps test: testdeps
go test ./... set -e; for dir in $(GO_MOD_DIRS); do \
go test ./... -short -race echo "go test in $${dir}"; \
go test ./... -run=NONE -bench=. -benchmem (cd "$${dir}" && \
env GOOS=linux GOARCH=386 go test ./... go test && \
go vet go test ./... -short -race &&
go test ./... -run=NONE -bench=. -benchmem &&
env GOOS=linux GOARCH=386 go test && \
go vet); \
done
cd internal/customvet && go build . cd internal/customvet && go build .
go vet -vettool ./internal/customvet/customvet go vet -vettool ./internal/customvet/customvet
@ -28,7 +32,7 @@ fmt:
goimports -w -local github.com/redis/go-redis ./ goimports -w -local github.com/redis/go-redis ./
go_mod_tidy: go_mod_tidy:
set -e; for dir in $(PACKAGE_DIRS); do \ set -e; for dir in $(GO_MOD_DIRS); do \
echo "go mod tidy in $${dir}"; \ echo "go mod tidy in $${dir}"; \
(cd "$${dir}" && \ (cd "$${dir}" && \
go get -u ./... && \ go get -u ./... && \