diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ec00b1cfb..bc96d4e66 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -66,6 +66,9 @@ "problemMatcher": [ "$go" ], + "options": { + "env": {"MOCK_API": "true"} + }, "presentation": { "reveal": "always" }, diff --git a/Makefile b/Makefile index 19a453402..db797631c 100644 --- a/Makefile +++ b/Makefile @@ -272,7 +272,7 @@ ENVTEST_ASSETS_DIR=$(shell pwd)/testbin test: manifests generate fmt vet ## Run tests. mkdir -p ${ENVTEST_ASSETS_DIR} test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.6.3/hack/setup-envtest.sh - source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test -mod=vendor ./... -coverprofile cover.out + source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); export MOCK_API=true; go test -mod=vendor ./... -coverprofile cover.out ##@ Build