Skip to content

feat(backend): postgres integration #2217

feat(backend): postgres integration

feat(backend): postgres integration #2217

name: KFP API Integration v1 tests
on:
push:
branches: [master]
pull_request:
paths:
- ".github/workflows/api-integration-tests-v1.yml"
- ".github/actions/create-cluster/**"
- ".github/resources/**"
- "api/**"
- "go.mod"
- "go.sum"
- "backend/**"
- "manifests/kustomize/**"
- "test/**"
- "!**/*.md"
- "!**/OWNERS"
concurrency:
group: legacy-integration-v1-tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
uses: ./.github/workflows/image-builds-with-cache.yml
initialization-integration-tests-v1:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
k8s_version: ["v1.29.2", "v1.34.0"]
db_type: ["mysql", "pgx"]
name: Initialization & Integration tests v1 - K8s ${{ matrix.k8s_version }} - ${{ matrix.db_type }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.9
- name: Set up Go
if: ${{ matrix.db_type == 'pgx' }}
uses: actions/setup-go@v5
with:
go-version: "1.24"
cache: true
- name: Create KFP cluster
id: create-kfp-cluster
uses: ./.github/actions/create-cluster
with:
k8s_version: ${{ matrix.k8s_version }}
continue-on-error: true
- name: Deploy
id: deploy
uses: ./.github/actions/deploy
if: ${{ steps.create-kfp-cluster.outcome == 'success' }}
with:
image_path: ${{ needs.build.outputs.IMAGE_PATH }}
image_tag: ${{ needs.build.outputs.IMAGE_TAG }}
image_registry: ${{ needs.build.outputs.IMAGE_REGISTRY }}
db_type: ${{ matrix.db_type == 'pgx' && matrix.db_type || '' }}
pipeline_store: "database"
forward_port: "true"
- name: Forward MySQL port
id: forward-mysql-port
if: ${{ steps.deploy.outcome == 'success' && matrix.db_type == 'mysql' }}
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "mysql" 3306 3306
continue-on-error: true
- name: Forward Postgres port
id: forward-postgres-port
if: ${{ steps.deploy.outcome == 'success' && matrix.db_type == 'pgx' }}
run: ./.github/resources/scripts/forward-port.sh "kubeflow" "postgres" 5432 5432
continue-on-error: true
- name: Wait for API server readiness
if: ${{ matrix.db_type == 'pgx' && steps.forward-postgres-port.outcome == 'success' }}
run: kubectl -n kubeflow wait --for=condition=available deploy/ml-pipeline --timeout=300s
- name: Initialization tests v1
id: initialization-tests
if: ${{ (matrix.db_type == 'mysql' && steps.forward-mysql-port.outcome == 'success') || (matrix.db_type == 'pgx' && steps.forward-postgres-port.outcome == 'success') }}
working-directory: ./backend/test/initialization
run: go test -v ./... -namespace=kubeflow -args -runIntegrationTests=true
env:
PULL_NUMBER: ${{ github.event.pull_request.number }}
continue-on-error: true
- name: API integration tests v1
id: integration-tests
if: ${{ (matrix.db_type == 'mysql' && steps.forward-mysql-port.outcome == 'success') || (matrix.db_type == 'pgx' && steps.forward-postgres-port.outcome == 'success') }}
working-directory: ./backend/test/integration
run: |
go test -v ./... \
${{ matrix.db_type == 'pgx' && '-skip TestUpgrade' || '' }} \
-args -runIntegrationTests=true \
${{ matrix.db_type == 'pgx' && '-runPostgreSQLTests=true' || '' }} \
-namespace=kubeflow \
-repoName=${{ github.repository }} \
-branchName=${{ github.ref_name }}
env:
PULL_NUMBER: ${{ github.event.pull_request.number }}
continue-on-error: true
- name: Collect failed logs
if: |
(matrix.db_type == 'mysql' && (steps.forward-mysql-port.outcome != 'success' || steps.integration-tests.outcome != 'success' || steps.initialization-tests.outcome != 'success')) ||
(matrix.db_type == 'pgx' && (steps.forward-postgres-port.outcome != 'success' || steps.integration-tests.outcome != 'success' || steps.initialization-tests.outcome != 'success'))
run: |
./.github/resources/scripts/collect-logs.sh --ns kubeflow --output /tmp/tmp_pod_log.txt
exit 1
- name: Collect test results
if: always()
uses: actions/upload-artifact@v4
with:
name: kfp-initialization-tests-v1-artifacts-k8s-${{ matrix.k8s_version }}-${{ matrix.db_type }}
path: /tmp/tmp*/*