mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-13 17:58:00 -07:00
Currently, we have different commands to run tests spread across different YAML files and comments in Go files. This change consolidates all the different commands, environment variables, and OS limits into 1 file that Travis, GitHub, and engineers can use to run tests.
28 lines
793 B
Makefile
28 lines
793 B
Makefile
export GO111MODULE := off
|
|
|
|
.PHONY: install-tools
|
|
install-tools:
|
|
go get -u honnef.co/go/tools/cmd/staticcheck
|
|
go get -u github.com/client9/misspell/cmd/misspell
|
|
|
|
.PHONY: lint
|
|
lint: goPkgs := $(shell GO111MODULE=$(GO111MODULE) go list ./...)
|
|
lint:
|
|
if [ -n "$$(gofmt -l .)" ]; then exit 1; fi
|
|
find . -type f -name "*.go" | grep -v "/vendor/" | xargs misspell -error -locale US
|
|
go vet $(goPkgs)
|
|
staticcheck $(goPkgs)
|
|
|
|
.PHONY: test-no-race
|
|
test-no-race:
|
|
if [ "$$(ulimit -n)" -lt "8192" ]; then exit 1; fi
|
|
go test -v -run=TestNoRace -failfast -p=1 ./...
|
|
.PHONY: test
|
|
test:
|
|
if [ "$$(ulimit -n)" -lt "8192" ]; then exit 1; fi
|
|
go test -v -race -p=1 -failfast ./...
|
|
.PHONY: test-tag
|
|
test-tag:
|
|
if [ "$$(ulimit -n)" -lt "8192" ]; then exit 1; fi
|
|
go test -v -run=TestVersionMatchesTag ./server
|