Skip to content

Commit 0a3fc59

Browse files
committed
ci: skip -race on integration tests
This requires building the codebase twice, and provides no value as the only code executed is test code. See https://blog.howardjohn.info/posts/go-build-times/#caching-tests Signed-off-by: John Howard <[email protected]> (cherry picked from commit 84c286c)
1 parent 839abb8 commit 0a3fc59

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,11 @@ test: ## Run all tests with ginkgo, or only run the test package at {TEST_PKG} i
180180
# will still have e2e tests run by Github Actions once they publish a pull
181181
# request.
182182
.PHONY: e2e-test
183+
e2e-test: go-test
184+
e2e-test: TEST_TAG = e2e
185+
e2e-test: GO_TEST_ARGS = $(E2E_GO_TEST_ARGS)
183186
e2e-test: dummy-idp-docker kind-load-dummy-idp
184-
e2e-test: ## Run only e2e tests, and only run the test package at {TEST_PKG} if it is specified
185-
@$(MAKE) --no-print-directory go-test TEST_TAG=e2e TEST_PKG=$(TEST_PKG)
187+
@:
186188

187189

188190
# https://go.dev/blog/cover#heat-maps
@@ -217,10 +219,12 @@ ifeq ($(GOARCH), arm64)
217219
endif
218220
endif
219221

222+
# Skip -race on e2e. This requires building the codebase twice, and provides no value as the only code executed is test code.
223+
E2E_GO_TEST_ARGS ?= -timeout=25m -cpu=4 -outputdir=$(OUTPUT_DIR)
220224
# Testing flags: https://pkg.go.dev/cmd/go#hdr-Testing_flags
221225
# The default timeout for a suite is 10 minutes, but this can be overridden by setting the -timeout flag. Currently set
222226
# to 25 minutes based on the time it takes to run the longest test setup (kgateway_test).
223-
GO_TEST_ARGS ?= -timeout=25m -cpu=4 -race -outputdir=$(OUTPUT_DIR)
227+
GO_TEST_ARGS ?= $(E2E_GO_TEST_ARGS) -race
224228
GO_TEST_COVERAGE_ARGS ?= --cover --covermode=atomic --coverprofile=cover.out
225229
GO_TEST_COVERAGE ?= go tool github.com/vladopajic/go-test-coverage/v2
226230

0 commit comments

Comments
 (0)