Skip to content

Commit

Permalink
build: enable -race for go test
Browse files Browse the repository at this point in the history
Signed-off-by: Paulo Gomes <[email protected]>
  • Loading branch information
Paulo Gomes committed Jun 13, 2022
1 parent 9f24443 commit 65d7918
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ BUILD_ARGS ?=
# Architectures to build images for
BUILD_PLATFORMS ?= linux/amd64,linux/arm64,linux/arm/v7

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

# Directory with versioned, downloaded things
CACHE := cache

Expand Down Expand Up @@ -138,10 +141,10 @@ endif
KUBEBUILDER_ASSETS?="$(shell $(ENVTEST) --arch=$(ENVTEST_ARCH) use -i $(ENVTEST_KUBERNETES_VERSION) --bin-dir=$(ENVTEST_ASSETS_DIR) -p path)"
test: $(LIBGIT2) tidy test-api test_deps generate fmt vet manifests api-docs install-envtest ## Run tests
KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) \
go test $(GO_STATIC_FLAGS) ./... -coverprofile cover.out
go test $(GO_STATIC_FLAGS) $(GO_TEST_ARGS) ./... -coverprofile cover.out

test-api: ## Run api tests
cd api; go test ./... -coverprofile cover.out
cd api; go test $(GO_TEST_ARGS) ./... -coverprofile cover.out

manager: $(LIBGIT2) generate fmt vet ## Build manager binary
go build -o $(BUILD_DIR)/bin/manager ./main.go
Expand Down

0 comments on commit 65d7918

Please sign in to comment.