Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tests): added makefiles for testing workflow tests locally #11509

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions .github/actions/kfp-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ runs:

- name: Build images
shell: bash
run: ./.github/resources/scripts/build-images.sh
run: make build-images

- name: Deploy KFP
shell: bash
run: ./.github/resources/scripts/deploy-kfp.sh
run: make deploy-kfp
4 changes: 2 additions & 2 deletions .github/actions/kfp-tekton-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ runs:

- name: Build images
shell: bash
run: ./.github/resources/scripts/build-images.sh
run: make build-images

- name: Deploy KFP
shell: bash
run: ./.github/resources/scripts/deploy-kfp-tekton.sh
run: make deploy-kfp-tekton
2 changes: 1 addition & 1 deletion .github/workflows/backend-visualization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
python-version: '3.9'

- name: Run tests
run: ./test/presubmit-backend-visualization.sh
run: make test-backend-visualization-test
19 changes: 6 additions & 13 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,24 @@ jobs:
python-version: '3.9'
- name: Install sdk
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install -e sdk/python
make setup-backend-test
- name: Create KFP cluster
uses: ./.github/actions/kfp-tekton-cluster
- name: "flip coin test"
run: |
. .venv/bin/activate
TEST_SCRIPT="test-flip-coin.sh" ./.github/resources/scripts/e2e-test.sh
make test-backend-test-flip-coin
- name: "static loop test"
run: |
. .venv/bin/activate
TEST_SCRIPT="test-static-loop.sh" ./.github/resources/scripts/e2e-test.sh
make test-backend-test-static-loop
- name: "dynamic loop test"
run: |
. .venv/bin/activate
TEST_SCRIPT="test-dynamic-loop.sh" ./.github/resources/scripts/e2e-test.sh
make test-backend-test-dynamic-loop
- name: "use env"
run: |
. .venv/bin/activate
TEST_SCRIPT="test-env.sh" ./.github/resources/scripts/e2e-test.sh
make test-backend-test-env
- name: "use volume"
run: |
. .venv/bin/activate
TEST_SCRIPT="test-volume.sh" ./.github/resources/scripts/e2e-test.sh
make test-backend-test-volume
- name: Collect test results
if: always()
uses: actions/upload-artifact@v4
Expand Down
27 changes: 5 additions & 22 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,8 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888

- name: Initialization tests v1
working-directory: ./backend/test/initialization
run: go test -v ./... -namespace kubeflow -args -runIntegrationTests=true
- name: Forward Port and initialize tests v1
run: make test-e2e-initialization-tests-v1

- name: Collect test results
if: always()
Expand Down Expand Up @@ -71,13 +67,8 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}


- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888

- name: Initialization tests v2
working-directory: ./backend/test/v2/initialization
run: go test -v ./... -namespace kubeflow -args -runIntegrationTests=true
run: make test-e2e-initialization-tests-v2

- name: Collect test results
if: always()
Expand Down Expand Up @@ -106,12 +97,8 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888

- name: API integration tests v1
working-directory: ./backend/test/integration
run: go test -v ./... -namespace ${NAMESPACE} -args -runIntegrationTests=true
run: make test-e2e-api-integration-tests-v1

- name: Collect test results
if: always()
Expand Down Expand Up @@ -140,12 +127,8 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888

- name: API integration tests v2
working-directory: ./backend/test/v2/integration
run: go test -v ./... -namespace ${NAMESPACE} -args -runIntegrationTests=true
run: make test-e2e-api-integration-tests-v2

- name: Collect test results
if: always()
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ jobs:
with:
node-version: '22'

- name: Clean npm cache
run: npm cache clean --force

- name: Install dependencies
run: cd ./frontend && npm ci

- name: Run Frontend Tests
run: cd ./frontend && npm run test:ci
run: make test-frontend

34 changes: 3 additions & 31 deletions .github/workflows/gcpc-modules-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,8 @@ jobs:
with:
python-version: 3.9

- name: apt-get update
run: sudo apt-get update

- name: Install protobuf-compiler
run: sudo apt-get install protobuf-compiler -y

- name: Install setuptools
run: |
pip3 install setuptools
pip3 freeze

- name: Install Wheel
run: pip3 install wheel==0.42.0

- name: Install python sdk
run: pip install sdk/python

- name: Generate API proto files
working-directory: ./api
run: make clean python

- name: Install kfp-pipeline-spec from source
run: |
python3 -m pip install api/v2alpha1/python

- name: Install google-cloud component
run: pip install components/google-cloud

- name: Install Pytest
run: pip install $(grep 'pytest==' sdk/python/requirements-dev.txt)
- name: Install requirements
run: make setup-grpc-modules-test

- name: Run test
run: pytest ./test/gcpc-tests/run_all_gcpc_modules.py
run: make test-grpc-modules
47 changes: 4 additions & 43 deletions .github/workflows/kfp-kubernetes-execution-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,47 +33,8 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888
- name: Install requirements
run: make setup-kfp-kubernetes-execution-tests-without-kfp

- name: apt-get update
run: sudo apt-get update

- name: Install protobuf-compiler
run: sudo apt-get install protobuf-compiler -y

- name: Install setuptools
run: |
pip3 install setuptools
pip3 freeze

- name: Install Wheel
run: pip3 install wheel==0.42.0

- name: Install protobuf
run: pip3 install protobuf==4.25.3

- name: Generate API proto files
working-directory: ./api
run: make clean python

- name: Install kfp-pipeline-spec from source
run: |
python3 -m pip install api/v2alpha1/python

- name: Generate kfp-kubernetes proto files from source
working-directory: ./kubernetes_platform
run: make clean python

- name: Install kfp-kubernetes from source
run: |
pip install -e ./kubernetes_platform/python[dev]

- name: Install requirements
run: pip install -r ./test/kfp-kubernetes-execution-tests/requirements.txt

- name: Run tests
run: |
export KFP_ENDPOINT="http://localhost:8888"
export TIMEOUT_SECONDS=2700
pytest ./test/kfp-kubernetes-execution-tests/sdk_execution_tests.py --asyncio-task-timeout $TIMEOUT_SECONDS
- name: Forward port and run tests
run: make test-kfp-kubernetes-execution-tests
2 changes: 1 addition & 1 deletion .github/workflows/kfp-kubernetes-library-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
python-version: ${{matrix.python.version}}

- name: Run tests
run: ./test/presubmit-test-kfp-kubernetes-library.sh
run: make test-kfp-kubernetes-library-test
7 changes: 2 additions & 5 deletions .github/workflows/kfp-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888

- name: Run Samples Tests
- name: Forward port and run samples tests
run: |
./backend/src/v2/test/sample-test.sh
make test-kfp-samples
2 changes: 1 addition & 1 deletion .github/workflows/kfp-sdk-runtime-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
- name: Run KFP Runtime Code Tests
run: |
export PULL_NUMBER="${{ github.event.inputs.pull_number || github.event.pull_request.number }}"
./test/presubmit-test-kfp-runtime-code.sh
make test-kfp-sdk-runtime-tests
3 changes: 1 addition & 2 deletions .github/workflows/kfp-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ jobs:
python-version: ${{ matrix.python }}

- name: Run SDK Tests
run: |
./test/presubmit-tests-sdk.sh
run: make test-kfp-sdk-tests
2 changes: 1 addition & 1 deletion .github/workflows/kubeflow-pipelines-manifests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
uses: actions/checkout@v4

- name: Run tests
run: ./manifests/kustomize/hack/presubmit.sh
run: make test-kubeflow-pipelines-manifests
11 changes: 4 additions & 7 deletions .github/workflows/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ jobs:
uses: ./.github/actions/kfp-cluster
with:
k8s_version: ${{ matrix.k8s_version }}
- name: Port forward kfp apiserver
run: |
nohup kubectl port-forward --namespace kubeflow svc/ml-pipeline 8888:8888 &
- name: Run Functional Tests
run: |
log_dir=$(mktemp -d)
./test/kfp-functional-test/kfp-functional-test.sh > $log_dir/periodic_tests.txt

- name: Port forward and run Functional Tests
run: make test-periodic-test

- name: Collect test results
if: always()
uses: actions/upload-artifact@v4
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/presubmit-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
paths:
- 'backend/**'
- 'test/presubmit-backend-test.sh'
- '.github/workflows/presubmit-backend.yml'

jobs:
backend-tests:
Expand All @@ -25,4 +26,4 @@ jobs:
go-version-file: go.mod

- name: Run Backend Tests
run: ./test/presubmit-backend-test.sh
run: make test-presubmit-backend
29 changes: 2 additions & 27 deletions .github/workflows/sdk-component-yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,8 @@ jobs:
with:
python-version: 3.9

- name: apt-get update
run: sudo apt-get update

- name: Install protobuf-compiler
run: sudo apt-get install protobuf-compiler -y

- name: Install setuptools
run: |
pip3 install setuptools
pip3 freeze

- name: Install Wheel
run: pip3 install wheel==0.42.0

- name: Install protobuf
run: pip3 install protobuf==4.25.3

- name: Generate API proto files
working-directory: ./api
run: make clean python

- name: Install kfp-pipeline-spec from source
run: |
python3 -m pip install api/v2alpha1/python

- name: Install requirements
run: pip install -r ./test/sdk-execution-tests/requirements.txt
run: make setup-sdk-component-yaml

- name: Run component YAML tests
run: ./test/presubmit-component-yaml.sh
run: make test-sdk-component-yaml
2 changes: 1 addition & 1 deletion .github/workflows/sdk-docformatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
python-version: 3.9

- name: Run docformatter tests
run: ./test/presubmit-docformatter-sdk.sh
run: make test-sdk-docformatter
37 changes: 4 additions & 33 deletions .github/workflows/sdk-execution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,10 @@ jobs:
with:
k8s_version: ${{ matrix.k8s_version }}

- name: Forward API port
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "ml-pipeline" 8888 8888

- name: apt-get update
run: sudo apt-get update

- name: Install protobuf-compiler
run: sudo apt-get install protobuf-compiler -y

- name: Install setuptools
run: |
pip3 install setuptools
pip3 freeze

- name: Install Wheel
run: pip3 install wheel==0.42.0

- name: Install protobuf
run: pip3 install protobuf==4.25.3

- name: Generate API proto files
working-directory: ./api
run: make clean python

- name: Install kfp-pipeline-spec from source
run: |
python3 -m pip install api/v2alpha1/python

# Same as sdk-component requirements
- name: Install requirements
run: pip install -r ./test/sdk-execution-tests/requirements.txt
run: make setup-sdk-component-yaml

- name: Run tests
- name: Forward API port and run tests
run: |
export KFP_ENDPOINT="http://localhost:8888"
export TIMEOUT_SECONDS=2700
pytest ./test/sdk-execution-tests/sdk_execution_tests.py --asyncio-task-timeout $TIMEOUT_SECONDS
make test-sdk-execution
2 changes: 1 addition & 1 deletion .github/workflows/sdk-isort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
python-version: 3.9

- name: Run isort tests
run: ./test/presubmit-isort-sdk.sh
run: make test-sdk-isort
2 changes: 1 addition & 1 deletion .github/workflows/sdk-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
python-version: 3.9

- name: Run SDK upgrade tests
run: ./test/presubmit-test-sdk-upgrade.sh
run: make test-sdk-upgrade
Loading
Loading