diff --git a/Makefile b/Makefile index 3f492256a07..be9712e174f 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,18 @@ SHELL := /bin/bash include ./Makefile.setup.mk +.PHONY: setup-python +setup-python: + python3 -m venv .venv && \ + source .venv/bin/activate + .PHONY: test-go-unittest test-go-unittest: go test -v -cover ./backend/... .PHONY: test-backend-test test-backend-test: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ TEST_SCRIPT="test-flip-coin.sh" ./.github/resources/scripts/e2e-test.sh && \ TEST_SCRIPT="test-static-loop.sh" ./.github/resources/scripts/e2e-test.sh && \ TEST_SCRIPT="test-dynamic-loop.sh" ./.github/resources/scripts/e2e-test.sh && \ @@ -17,27 +22,27 @@ test-backend-test: .PHONY: test-backend-test-flip-coin test-backend-test-flip-coin: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ TEST_SCRIPT="test-flip-coin.sh" ./.github/resources/scripts/e2e-test.sh .PHONY: test-backend-test-static-loop test-backend-test-static-loop: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ TEST_SCRIPT="test-static-loop.sh" ./.github/resources/scripts/e2e-test.sh .PHONY: test-backend-test-dynamic-loop test-backend-test-dynamic-loop: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ TEST_SCRIPT="test-dynamic-loop.sh" ./.github/resources/scripts/e2e-test.sh .PHONY: test-backend-test-env test-backend-test-env: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ TEST_SCRIPT="test-env.sh" ./.github/resources/scripts/e2e-test.sh .PHONY: test-backend-test-volume test-backend-test-volume: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ TEST_SCRIPT="test-volume.sh" ./.github/resources/scripts/e2e-test.sh .PHONY: test-backend-visualization-test @@ -78,7 +83,7 @@ test-e2e-frontend-integration-test: .PHONY: test-e2e-basic-sample-tests test-e2e-basic-sample-tests: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888 && \ pip3 install -r ./test/sample-test/requirements.txt && \ python3 ./test/sample-test/sample_test_launcher.py sample_test run_test --namespace kubeflow --test-name sequential --results-gcs-dir output && \ @@ -88,16 +93,16 @@ test-e2e-basic-sample-tests: test-frontend: npm cache clean --force && \ cd ./frontend && npm ci && \ - cd ./frontend && npm run test:ci + npm run test:ci .PHONY: test-grpc-modules test-grpc-modules: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ pytest ./test/gcpc-tests/run_all_gcpc_modules.py .PHONY: test-kfp-kubernetes-execution-tests test-kfp-kubernetes-execution-tests: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888 && \ export KFP_ENDPOINT="http://localhost:8888" && \ export TIMEOUT_SECONDS=2700 && \ @@ -109,18 +114,18 @@ test-kfp-kubernetes-library-test: .PHONY: test-kfp-samples test-kfp-samples: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888 && \ ./backend/src/v2/test/sample-test.sh .PHONY: test-kfp-sdk-runtime-tests test-kfp-sdk-runtime-tests: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ ./test/presubmit-test-kfp-runtime-code.sh .PHONY: test-kfp-sdk-tests test-kfp-sdk-tests: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ ./test/presubmit-tests-sdk.sh .PHONY: test-kubeflow-pipelines-manifests @@ -129,7 +134,7 @@ test-kubeflow-pipelines-manifests: .PHONY: test-periodic-test test-periodic-test: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ nohup kubectl port-forward --namespace kubeflow svc/ml-pipeline 8888:8888 > kubectl-port-forward.log 2>&1 & \ log_dir=$$(mktemp -d) && \ ./test/kfp-functional-test/kfp-functional-test.sh > $$log_dir/periodic_tests.txt @@ -140,17 +145,17 @@ test-presubmit-backend: .PHONY: test-sdk-component-yaml test-sdk-component-yaml: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ ./test/presubmit-component-yaml.sh .PHONY: test-sdk-docformatter test-sdk-docformatter: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ ./test/presubmit-docformatter-sdk.sh .PHONY: test-sdk-execution test-sdk-execution: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888 && \ export KFP_ENDPOINT="http://localhost:8888" && \ export TIMEOUT_SECONDS=2700 && \ @@ -158,15 +163,15 @@ test-sdk-execution: .PHONY: test-sdk-isort test-sdk-isort: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ ./test/presubmit-isort-sdk.sh .PHONY: test-sdk-upgrade test-sdk-upgrade: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ ./test/presubmit-test-sdk-upgrade.sh .PHONY: test-sdk-yapf test-sdk-yapf: - source .venv/bin/activate && \ + $(MAKE) setup-python && \ ./test/presubmit-yapf-sdk.sh \ No newline at end of file