diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20a09d9dd3..1f8f78f25f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,6 +45,7 @@ go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger go get -u github.com/golangci/golangci-lint/cmd/golangci-lint go get -u github.com/mattn/goreman +go get -u gotest.tools/gotestsum ``` ## Building diff --git a/Makefile b/Makefile index 76aca8a918..83e5bda6fa 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ GIT_COMMIT=$(shell git rev-parse HEAD) GIT_TAG=$(shell if [ -z "`git status --porcelain`" ]; then git describe --exact-match --tags HEAD 2>/dev/null; fi) GIT_TREE_STATE=$(shell if [ -z "`git status --porcelain`" ]; then echo "clean" ; else echo "dirty"; fi) PACKR_CMD=$(shell if [ "`which packr`" ]; then echo "packr"; else echo "go run vendor/github.com/gobuffalo/packr/packr/main.go"; fi) +TEST_CMD=$(shell [ "`which gotestsum`" != "" ] && echo gotestsum -- || echo go test) # docker image publishing options DOCKER_PUSH=false @@ -130,16 +131,16 @@ lint: golangci-lint run --fix .PHONY: build -build: lint +build: go build `go list ./... | grep -v resource_customizations` .PHONY: test -test: build - go test -covermode=count -coverprofile=coverage.out `go list ./... | grep -v "github.com/argoproj/argo-cd/test/e2e"` +test: + $(TEST_CMD) -covermode=count -coverprofile=coverage.out `go list ./... | grep -v "github.com/argoproj/argo-cd/test/e2e"` .PHONY: test-e2e test-e2e: cli - go test -v -failfast -timeout 20m ./test/e2e + $(TEST_CMD) -v -failfast -timeout 20m ./test/e2e # Cleans VSCode debug.test files from sub-dirs to prevent them from being included in packr boxes .PHONY: clean-debug @@ -151,7 +152,7 @@ clean: clean-debug -rm -rf ${CURRENT_DIR}/dist .PHONY: pre-commit -pre-commit: dep-ensure codegen test +pre-commit: dep-ensure codegen build lint test .PHONY: release-precheck release-precheck: manifests