Skip to content

Commit aaf4a4d

Browse files
hiddecoMax Jonas Werner
authored andcommitted
build: enable -race for go test
Signed-off-by: Hidde Beydals <[email protected]>
1 parent d425923 commit aaf4a4d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ LIBGIT2_IMG ?= ghcr.io/fluxcd/golang-with-libgit2
77
LIBGIT2_TAG ?= libgit2-1.3.1
88

99
# Allows for defining additional Go test args, e.g. '-tags integration'.
10-
GO_TEST_ARGS ?=
10+
GO_TEST_ARGS ?= -race
1111

1212
# Allows for defining additional Docker buildx arguments,
1313
# e.g. '--push'.
1414
BUILD_ARGS ?=
1515
# Architectures to build images for
1616
BUILD_PLATFORMS ?= linux/amd64,linux/arm64,linux/arm/v7
1717

18-
# Go additional tag arguments, e.g. 'integration'
18+
# Go additional tag arguments, e.g. 'integration',
19+
# this is append to the tag arguments required for static builds
1920
GO_TAGS ?=
2021

2122
# Produce CRDs that work back to Kubernetes 1.16
@@ -111,7 +112,7 @@ ifeq ($(shell uname -s),Darwin)
111112
endif
112113

113114
test-api: ## Run api tests
114-
cd api; go test ./... -coverprofile cover.out
115+
cd api; go test $(GO_TEST_ARGS) ./... -coverprofile cover.out
115116

116117
run: $(LIBGIT2) generate fmt vet manifests ## Run against the configured Kubernetes cluster in ~/.kube/config
117118
go run $(GO_STATIC_FLAGS) ./main.go

0 commit comments

Comments
 (0)