Skip to content

Commit

Permalink
test: Add script and GitHub Action for kfp-kubernetes-library
Browse files Browse the repository at this point in the history
Signed-off-by: Diego Lovison <diegolovison@gmail.com>
  • Loading branch information
diegolovison committed Jul 15, 2024
1 parent 4930bee commit b5f24aa
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 4 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/kfp-kubernetes-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: KFP K8s Platform Tests

on:
push:
branches: [master]
pull_request:
paths:
- '.github/workflows/kfp-kubernetes-library.yaml'
- 'sdk/python/**'
- 'api/v2alpha1/**'
- 'kubernetes_platform/**'
- 'test/presubmit-test-kfp-kubernetes-library.sh'

jobs:
kfp-kubernetes-library-test:
runs-on: ubuntu-24.04
strategy:
matrix:
python: [
{ 'version': '3.8' },
{ 'version': '3.9' },
{ 'version': '3.10' },
{ 'version': '3.11' },
{ 'version': '3.12' }
]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python.version}}

- name: Run tests
# original file is using sudo
run: ./test/presubmit-test-kfp-kubernetes-library.sh
16 changes: 12 additions & 4 deletions test/presubmit-test-kfp-kubernetes-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@

source_root=$(pwd)

user_id=`id -u`
if [$user_id -eq 0]; then
apt-get update && apt-get install -y protobuf-compiler
# rust needed for transitive deps in dev extras on Python:3.12
apt-get install rustc -y
else
sudo apt-get update && sudo apt-get install -y protobuf-compiler
# rust needed for transitive deps in dev extras on Python:3.12
sudo apt-get install rustc -y
fi

pip install --upgrade pip
pip install wheel

pip install sdk/python
apt-get update && apt-get install -y protobuf-compiler

pushd api
make clean python
popd
Expand All @@ -31,7 +41,5 @@ pushd "$source_root/kubernetes_platform"
make clean python
popd

# rust needed for transitive deps in dev extras on Python:3.12
apt-get install rustc -y
pip install -e "$source_root/kubernetes_platform/python[dev]"
pytest "$source_root/kubernetes_platform/python/test" -n auto

0 comments on commit b5f24aa

Please sign in to comment.