Skip to content

Commit

Permalink
chore: Makefile tests with shorter timeout and common flags (#1397)
Browse files Browse the repository at this point in the history
  • Loading branch information
orpheuslummis authored Apr 25, 2023
1 parent a0160e0 commit 75f6da8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ BUILD_FLAGS=-trimpath -ldflags "\
-X 'github.com/sourcenetwork/defradb/version.GitCommitDate=$(VERSION_GITCOMMITDATE)'"
endif

TEST_FLAGS=-race -shuffle=on -timeout 60s

default:
@go run $(BUILD_FLAGS) cmd/defradb/main.go

Expand Down Expand Up @@ -143,28 +145,28 @@ endif

.PHONY: test
test:
gotestsum --format pkgname -- ./... -race -shuffle=on
gotestsum --format pkgname -- ./... $(TEST_FLAGS)

# Only build the tests (don't execute them).
.PHONY: test\:build
test\:build:
gotestsum --format pkgname -- ./... -race -shuffle=on -run=nope
gotestsum --format pkgname -- ./... $(TEST_FLAGS) -run=nope

.PHONY: test\:ci
test\:ci:
DEFRA_BADGER_MEMORY=true DEFRA_BADGER_FILE=true $(MAKE) test:names

.PHONY: test\:go
test\:go:
go test ./... -race -shuffle=on
go test ./... $(TEST_FLAGS)

.PHONY: test\:names
test\:names:
gotestsum --format testname -- ./... -race -shuffle=on
gotestsum --format testname -- ./... $(TEST_FLAGS)

.PHONY: test\:verbose
test\:verbose:
gotestsum --format standard-verbose -- ./... -race -shuffle=on
gotestsum --format standard-verbose -- ./... $(TEST_FLAGS)

.PHONY: test\:watch
test\:watch:
Expand Down

0 comments on commit 75f6da8

Please sign in to comment.