Skip to content

Commit

Permalink
Merge pull request #320 from gkurz/unplug-make-test
Browse files Browse the repository at this point in the history
Allow to skip `go test`
  • Loading branch information
gkurz authored May 25, 2023
2 parents 5b315cb + 48942c6 commit 560078d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ space := $() $()
comma := ,
GOFLAGS := -tags=$(subst $(space),$(comma),$(strip $(BUILTIN_CLOUD_PROVIDERS)))

#
# If SKIP_TESTS is set, the test target will *not* run `go test`.
# This is to be able to temporarily work around test failures when doing
# local development.
SKIP_TESTS =

.PHONY: all
all: build

Expand Down Expand Up @@ -116,9 +122,13 @@ vet: ## Run go vet against code.

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
ifneq (, $(SKIP_TESTS))
@echo Skipping tests. Unset SKIP_TESTS to actually run them.
else
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(GOFLAGS) ./... -coverprofile cover.out
# set write flag on created folder, so that we can clean it up
chmod +w $(LOCALBIN)/k8s/$(ENVTEST_K8S_VERSION)*
endif

##@ Build

Expand Down

0 comments on commit 560078d

Please sign in to comment.