diff options
Diffstat (limited to 'Makefile.util.mk')
-rw-r--r-- | Makefile.util.mk | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Makefile.util.mk b/Makefile.util.mk index 0dee14d4..a2eea8bf 100644 --- a/Makefile.util.mk +++ b/Makefile.util.mk @@ -7,38 +7,38 @@ GOLANGCI_VERSION=v1.44.0 GOTESTSUM_VERSION=v1.7.0 COVERAGE_PACKAGES=$(shell (go list ./... | grep -v -e "test/acceptance" | tr "\n", "," | sed 's/\(.*\),/\1 /')) -lint: .GOPATH/.ok +lint: $Q go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_VERSION) run ./... --out-format $(OUT_FORMAT) $(LINT_FLAGS) | tee ${REPORT_FILE} -format: .GOPATH/.ok +format: $Q go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_VERSION) run ./... --fix --out-format $(OUT_FORMAT) $(LINT_FLAGS) | tee ${REPORT_FILE} -test: .GOPATH/.ok gitlab-pages +test: gitlab-pages rm -f tests.out go run gotest.tools/gotestsum@$(GOTESTSUM_VERSION) --junitfile junit-test-report.xml --format testname -- ./... ${ARGS} -race: .GOPATH/.ok gitlab-pages +race: gitlab-pages go run gotest.tools/gotestsum@$(GOTESTSUM_VERSION) --junitfile junit-test-report.xml --format testname -- -race $(if $V,-v) ./... ${ARGS} -acceptance: .GOPATH/.ok gitlab-pages +acceptance: gitlab-pages go run gotest.tools/gotestsum@$(GOTESTSUM_VERSION) --junitfile junit-test-report.xml --format testname -- $(if $V,-v) ./test/acceptance ${ARGS} -bench: .GOPATH/.ok gitlab-pages +bench: gitlab-pages go test -bench=. -run=^$$ ./... # The acceptance tests cannot count for coverage cover: @echo "NOTE: make cover does not exit 1 on failure, don't use it to check for tests success!" - $Q rm -f .GOPATH/cover/test.coverage - $Q mkdir -p .GOPATH/cover - $Q go test -short -cover -coverpkg=$(COVERAGE_PACKAGES) -coverprofile=.GOPATH/cover/test.coverage ./... - $Q go tool cover -html .GOPATH/cover/test.coverage -o coverage.html + $Q rm -f .cover/test.coverage + $Q mkdir -p .cover + $Q go test -short -cover -coverpkg=$(COVERAGE_PACKAGES) -coverprofile=.cover/test.coverage ./... + $Q go tool cover -html .cover/test.coverage -o coverage.html @echo "" @echo "=====> Total test coverage: <=====" @echo "" - $Q go tool cover -func .GOPATH/cover/test.coverage + $Q go tool cover -func .cover/test.coverage -deps-check: .GOPATH/.ok +deps-check: go mod tidy @if git diff --color=always --exit-code -- go.mod go.sum; then \ echo "go.mod and go.sum are ok"; \ @@ -48,7 +48,7 @@ deps-check: .GOPATH/.ok exit 1; \ fi; -mocks-check: .GOPATH/.ok generate-mocks +mocks-check: generate-mocks @if git diff --color=always --exit-code -- *_mock.go; then \ echo "mocks are ok"; \ else \ @@ -57,7 +57,7 @@ mocks-check: .GOPATH/.ok generate-mocks exit 1; \ fi; -deps-download: .GOPATH/.ok +deps-download: go mod download changelog: |