Skip to content

Commit fe9e12d

Browse files
committed
build: Only run e2e tests if there are e2e test files
1 parent 205c446 commit fe9e12d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

make/go.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ E2E_FLAKE_ATTEMPTS ?= 1
8080
e2e-test: ## Runs e2e tests
8181
e2e-test: install-tool.golang install-tool.ginkgo install-tool.gojq
8282
$(info $(M) running e2e tests$(if $(E2E_LABEL), labelled "$(E2E_LABEL)")$(if $(E2E_FOCUS), matching "$(E2E_FOCUS)"))
83-
$(MAKE) GORELEASER_FLAGS=$$'--config=<(env GOOS=$(shell go env GOOS) GOARCH=$(shell go env GOARCH) gojq --yaml-input --yaml-output \'del(.builds[0].goarch) | del(.builds[0].goos) | .builds[0].targets|=(["linux_amd64","linux_arm64",env.GOOS+"_"+env.GOARCH] | unique | map(. | sub("_amd64";"_amd64_v1")))\' .goreleaser.yml) --rm-dist --skip-validate --skip-publish' release
83+
ifneq ($(wildcard test/e2e/*),)
84+
ifneq ($(SKIP_BUILD),true)
85+
$(MAKE) GORELEASER_FLAGS=$$'--config=<(env GOOS=$(shell go env GOOS) GOARCH=$(shell go env GOARCH) gojq --yaml-input --yaml-output \'del(.builds[0].goarch) | del(.builds[0].goos) | .builds[0].targets|=(["linux_amd64","linux_arm64",env.GOOS+"_"+env.GOARCH] | unique | map(. | sub("_amd64";"_amd64_v1")))\' .goreleaser.yml) --clean --skip-validate --skip-publish' release
86+
endif
8487
ginkgo run \
8588
--r \
8689
--race \
@@ -107,6 +110,7 @@ e2e-test: install-tool.golang install-tool.ginkgo install-tool.gojq
107110
go tool cover \
108111
-html=coverage-e2e.out \
109112
-o coverage-e2e.html
113+
endif
110114

111115
GOLANGCI_CONFIG_FILE ?= $(wildcard $(REPO_ROOT)/.golangci.y*ml)
112116

0 commit comments

Comments
 (0)