diff --git a/.github/resources/unittests/application_default_credentials.json b/.github/resources/unittests/application_default_credentials.json new file mode 100644 index 00000000000..9dd9c45b31d --- /dev/null +++ b/.github/resources/unittests/application_default_credentials.json @@ -0,0 +1,12 @@ +{ + "type": "service_account", + "project_id": "your-project-id", + "private_key_id": "your-private-key-id", + "private_key": "-----BEGIN PRIVATE KEY-----\nYour private key content\n-----END PRIVATE KEY-----\n", + "client_email": "your-client-email@your-project.iam.gserviceaccount.com", + "client_id": "your-client-id", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://accounts.google.com/o/oauth2/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/your-client-email@your-project.iam.gserviceaccount.com" +} diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml new file mode 100644 index 00000000000..fff33c3c323 --- /dev/null +++ b/.github/workflows/unit-tests.yaml @@ -0,0 +1,29 @@ +name: Unit Tests +on: + pull_request: + paths: + - go.mod + - go.sum + - backend/** + types: + - opened + - reopened + - closed + - synchronize + workflow_dispatch: +env: + RESOURCES_DIR: ${{ github.workspace }}/.github/resources +jobs: + functest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.20.x' + - name: Run Unit Test + working-directory: ${{ github.workspace }}/backend/src + env: + GOOGLE_APPLICATION_CREDENTIALS: ${{ env.RESOURCES_DIR }}/unittests/application_default_credentials.json + run: go test ./... diff --git a/backend/src/v2/compiler/argocompiler/testdata/create_mount_delete_dynamic_pvc.yaml b/backend/src/v2/compiler/argocompiler/testdata/create_mount_delete_dynamic_pvc.yaml index 7402e9e16d8..dad0b7dd1ac 100644 --- a/backend/src/v2/compiler/argocompiler/testdata/create_mount_delete_dynamic_pvc.yaml +++ b/backend/src/v2/compiler/argocompiler/testdata/create_mount_delete_dynamic_pvc.yaml @@ -142,6 +142,16 @@ spec: volumeMounts: - mountPath: /kfp-launcher name: kfp-launcher + - mountPath: /gcs + name: gcs-scratch + - mountPath: /s3 + name: s3-scratch + - mountPath: /minio + name: minio-scratch + - mountPath: /.local + name: dot-local-scratch + - mountPath: /.cache + name: dot-cache-scratch initContainers: - command: - launcher-v2 @@ -168,6 +178,16 @@ spec: volumes: - emptyDir: {} name: kfp-launcher + - emptyDir: { } + name: gcs-scratch + - emptyDir: { } + name: s3-scratch + - emptyDir: { } + name: minio-scratch + - emptyDir: { } + name: dot-local-scratch + - emptyDir: { } + name: dot-cache-scratch - dag: tasks: - arguments: diff --git a/backend/src/v2/compiler/argocompiler/testdata/hello_world.yaml b/backend/src/v2/compiler/argocompiler/testdata/hello_world.yaml index 7d44562a534..ff77e358897 100644 --- a/backend/src/v2/compiler/argocompiler/testdata/hello_world.yaml +++ b/backend/src/v2/compiler/argocompiler/testdata/hello_world.yaml @@ -125,6 +125,16 @@ spec: volumeMounts: - mountPath: /kfp-launcher name: kfp-launcher + - mountPath: /gcs + name: gcs-scratch + - mountPath: /s3 + name: s3-scratch + - mountPath: /minio + name: minio-scratch + - mountPath: /.local + name: dot-local-scratch + - mountPath: /.cache + name: dot-cache-scratch initContainers: - command: - launcher-v2 @@ -151,6 +161,16 @@ spec: volumes: - emptyDir: {} name: kfp-launcher + - emptyDir: {} + name: gcs-scratch + - emptyDir: {} + name: s3-scratch + - emptyDir: {} + name: minio-scratch + - emptyDir: {} + name: dot-local-scratch + - emptyDir: {} + name: dot-cache-scratch - dag: tasks: - arguments: