Skip to content

Commit

Permalink
Prevent accidentally running the tests on a cluster other than Minikube.
Browse files Browse the repository at this point in the history
  • Loading branch information
sgielen committed May 28, 2024
1 parent 6693032 commit 33bfb65
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ vet: ## Run go vet against code.

.PHONY: test
test: manifests generate fmt vet envtest ## Run tests.
@[ "$(shell $(KUBECTL) config current-context)" = "minikube" ] || { \
echo >&2 ; \
echo "Cowardly refusing to run tests with a context other than minikube. Please see the README." >&2 ; \
echo >&2 ; \
exit 1 ; \
}
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out -ginkgo.v -test.v

GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
Expand Down

0 comments on commit 33bfb65

Please sign in to comment.