@@ -66,8 +66,8 @@ test: manifests generate fmt vet envtest ## Run tests.
66
66
# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
67
67
.PHONY : test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
68
68
test-e2e :
69
+ @$(prompt_for_e2e_test_execution )
69
70
go test ./test/e2e/ -v -ginkgo.v
70
-
71
71
.PHONY : lint
72
72
lint : golangci-lint # # Run golangci-lint linter & yamllint
73
73
$(GOLANGCI_LINT ) run
@@ -196,3 +196,25 @@ GOBIN=$(LOCALBIN) go install $${package} ;\
196
196
mv "$$(echo "$(1 ) " | sed "s/-$(3 ) $$//" ) " $(1 ) ;\
197
197
}
198
198
endef
199
+
200
+ define prompt_for_e2e_test_execution
201
+ if [ "$$(echo "$(KUBEFLOW_TEST_PROMPT ) " | tr '[:upper:]' '[:lower:]' ) " = "false" ]; then \
202
+ echo "Skipping E2E test confirmation prompt (KUBEFLOW_TEST_PROMPT is set to true)"; \
203
+ else \
204
+ current_k8s_context=$$(kubectl config current-context ) ; \
205
+ echo "================================ WARNING ================================"; \
206
+ echo "E2E tests use your current Kubernetes context!"; \
207
+ echo "This will DELETE EXISTING RESOURCES such as cert-manager!"; \
208
+ echo "Current context: '$$current_k8s_context'"; \
209
+ echo "========================================================================="; \
210
+ echo "Proceed with E2E tests? (yes/NO)"; \
211
+ read user_confirmation; \
212
+ case $$user_confirmation in \
213
+ [yY] | [yY][eE][sS] ) \
214
+ echo "Running E2E tests...";; \
215
+ [nN] | [nN][oO] | * ) \
216
+ echo "Aborting E2E tests..."; \
217
+ exit 1; \
218
+ esac \
219
+ fi
220
+ endef
0 commit comments