Skip to content

Commit 2a4d375

Browse files
committed
backport of commit f860ed5
1 parent 561215d commit 2a4d375

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

Makefile

+25-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ KUBECTL_VERSION= $(shell ./control-plane/build-support/scripts/read-yaml-config.
99

1010
GO_MODULES := $(shell find . -name go.mod -exec dirname {} \; | sort)
1111

12+
GOTESTSUM_PATH?=$(shell command -v gotestsum)
13+
1214
##@ Helm Targets
1315

1416
.PHONY: gen-helm-docs
@@ -97,11 +99,32 @@ control-plane-fips-dev-docker: ## Build consul-k8s-control-plane FIPS dev Docker
9799

98100
.PHONY: control-plane-test
99101
control-plane-test: ## Run go test for the control plane.
100-
cd control-plane; go test ./...
102+
ifeq ("$(GOTESTSUM_PATH)","")
103+
cd control-plane && go test ./...
104+
else
105+
cd control-plane && \
106+
gotestsum \
107+
--format=short-verbose \
108+
--debug \
109+
--rerun-fails=3 \
110+
--packages="./..."
111+
endif
112+
101113

102114
.PHONY: control-plane-ent-test
103115
control-plane-ent-test: ## Run go test with Consul enterprise tests. The consul binary in your PATH must be Consul Enterprise.
104-
cd control-plane; go test ./... -tags=enterprise
116+
ifeq ("$(GOTESTSUM_PATH)","")
117+
cd control-plane && go test ./... -tags=enterprise
118+
else
119+
cd control-plane && \
120+
gotestsum \
121+
--format=short-verbose \
122+
--debug \
123+
--rerun-fails=3 \
124+
--packages="./..." \
125+
-- \
126+
--tags enterprise
127+
endif
105128

106129
.PHONY: control-plane-cov
107130
control-plane-cov: ## Run go test with code coverage.

0 commit comments

Comments
 (0)