@@ -66,7 +66,7 @@ FILE_ARCH=x86-64
6666DOCKER_ARCH =
6767endif
6868$(info Building for GOARCH=$(GOARCH))
69- all : lint test kube-router container # # Default target. Lints code, runs tests, builds binaries and images.
69+ all : lint test-pretty kube-router container # # Default target. Lints code, runs tests, builds binaries and images.
7070
7171kube-router :
7272 @echo Starting kube-router binary build.
9898 go test -v -timeout 30s github.com/cloudnativelabs/kube-router/v2/cmd/kube-router/ github.com/cloudnativelabs/kube-router/v2/pkg/...
9999endif
100100
101+ test-pretty : gofmt # # Runs code quality pipelines (gofmt, tests, coverage, etc)
102+ ifeq "$(BUILD_IN_DOCKER ) " "true"
103+ $(DOCKER) run -v $(PWD):/go/src/github.com/cloudnativelabs/kube-router \
104+ -v $(GO_CACHE):/root/.cache/go-build \
105+ -v $(GO_MOD_CACHE):/go/pkg/mod \
106+ -w /go/src/github.com/cloudnativelabs/kube-router $(DOCKER_BUILD_IMAGE) \
107+ sh -c \
108+ 'go install gotest.tools/gotestsum@latest && CGO_ENABLED=0 gotestsum --format gotestdox -- -timeout 30s github.com/cloudnativelabs/kube-router/v2/cmd/kube-router/ github.com/cloudnativelabs/kube-router/v2/pkg/...'
109+ else
110+ ifeq ($(shell command -v gotestsum 2>/dev/null) ,)
111+ go install gotest.tools/gotestsum@latest
112+ endif
113+ gotestsum --format gotestdox -- -timeout 30s github.com/cloudnativelabs/kube-router/v2/cmd/kube-router/ github.com/cloudnativelabs/kube-router/v2/pkg/...
114+ endif
115+
101116lint : gofmt markdownlint
102117ifeq "$(BUILD_IN_DOCKER ) " "true"
103118 $(DOCKER) run -v $(PWD):/go/src/github.com/cloudnativelabs/kube-router \
@@ -250,7 +265,7 @@ help:
250265 awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-22s\033[0m %s\n", $$1, $$2}'
251266
252267.PHONY : clean container run release goreleaser push gofmt gofmt-fix gomoqs
253- .PHONY : test lint docker-login push-manifest push-manifest-release
268+ .PHONY : test test-pretty lint docker-login push-manifest push-manifest-release
254269.PHONY : push-release github-release help multiarch-binverify markdownlint
255270
256271.DEFAULT : all
0 commit comments