-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use gotestsum for test execution (#2586)
- Loading branch information
Showing
2 changed files
with
7 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
.PHONY: help default build run run-mt test test-run test-teardown mocks | ||
|
||
GO=go | ||
GINKGO=ginkgo | ||
LDFLAGS?=-s -w | ||
TESTFILE=_testok | ||
|
||
|
@@ -10,11 +9,16 @@ default: build | |
mocks: install-tools ## Generate all mocks | ||
$(GO) generate ./... | ||
|
||
test: test-run test-teardown | ||
test: install-tools test-run test-teardown | ||
|
||
test-run: ## Run all unit tests | ||
ifeq ($(filter 1,$(debug) $(RUNNER_DEBUG)),) | ||
$(eval TEST_CMD = SLOW=0 gotestsum --format pkgname-and-test-fails --) | ||
$(eval TEST_OPTIONS = -p=1 -v -failfast -shuffle=on -coverprofile=profile.out -covermode=atomic -vet=all --timeout=15m) | ||
else | ||
$(eval TEST_CMD = SLOW=0 go test) | ||
$(eval TEST_OPTIONS = -p=1 -v -failfast -shuffle=on -coverprofile=profile.out -covermode=atomic -vet=all --timeout=15m) | ||
endif | ||
ifdef package | ||
$(TEST_CMD) $(TEST_OPTIONS) $(package) && touch $(TESTFILE) || true | ||
else | ||
|
@@ -64,6 +68,7 @@ install-tools: | |
go install mvdan.cc/gofumpt@latest | ||
go install google.golang.org/protobuf/cmd/[email protected] | ||
go install google.golang.org/grpc/cmd/[email protected] | ||
go install gotest.tools/[email protected] | ||
|
||
.PHONY: lint | ||
lint: fmt ## Run linters on all go files | ||
|