Repository navigation
171 lines (157 loc) · 6.31 KB
/
Copy pathpy-cli-e2e-tests-v2.yml
File metadata and controls
171 lines (157 loc) · 6.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# Copyright 2026 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# CLI E2E v2 — strangler-fig replacement for py-cli-e2e-tests.yml.
#
# Each connector lives under ingestion/tests/cli_e2e_v2/<connector>/ and
# is a self-contained pytest module (no inheritance). The matrix below
# grows as migrated connector suites are ready for CI; each connector's
# v1 entry remains until the replacement has passed its stability window.
#
# Triggers: workflow_dispatch during the v2 stabilization window. A
# schedule can be added after the connector suites are consistently green.
name: py-cli-e2e-tests-v2
on:
workflow_dispatch:
inputs:
connectors:
description: "Connectors to run (JSON array)"
required: true
default: '["mysql", "postgres", "bigquery", "oracle", "snowflake", "mssql"]'
permissions:
id-token: write
contents: read
jobs:
prepare-spacy-model:
permissions:
contents: read
cache-mode: read
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ github.sha }}
persist-credentials: false
- uses: ./.github/actions/prepare-classification-models
py-cli-e2e-tests-v2:
needs: prepare-spacy-model
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
connector: ${{ fromJSON(inputs.connectors || '["mysql", "postgres", "bigquery", "oracle", "snowflake", "mssql"]') }}
# The v1 Snowflake job drops and recreates the same E2E database, so both workflows put their
# Snowflake jobs in one group that runs one at a time. A newer pending job replaces an older one.
concurrency:
group: ${{ matrix.connector == 'snowflake' && 'cli-e2e-snowflake-database' || format('{0}-{1}-{2}', github.workflow, github.run_id, matrix.connector) }}
cancel-in-progress: false
environment: test
env:
E2E_CONNECTOR: ${{ matrix.connector }}
steps:
- name: Validate connector
shell: bash
run: |
case "$E2E_CONNECTOR" in
mysql|postgres|bigquery|oracle|snowflake|mssql) ;;
*) echo "Unsupported E2E connector" >&2; exit 1 ;;
esac
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
swap-storage: true
docker-images: false
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Setup Openmetadata Test Environment
uses: ./.github/actions/setup-openmetadata-test-environment
with:
python-version: '3.10'
classification-models: 'true'
- name: Run CLI E2E v2 tests
id: e2e-v2-test
if: matrix.connector != 'bigquery' && matrix.connector != 'snowflake'
env:
# The bundled server uses these admin credentials to mint a JWT.
OM_ADMIN_EMAIL: admin@open-metadata.org
OM_ADMIN_PASSWORD: admin
run: |
source env/bin/activate
cd ingestion
mkdir -p junit
pytest -v \
--e2e-contract-check \
--junitxml="junit/test-results-v2-${E2E_CONNECTOR}.xml" \
"tests/cli_e2e_v2/${E2E_CONNECTOR}"
shell: bash
- name: Run BigQuery CLI E2E v2 tests
id: e2e-v2-bigquery-test
if: matrix.connector == 'bigquery'
env:
OM_ADMIN_EMAIL: admin@open-metadata.org
OM_ADMIN_PASSWORD: admin
E2E_BQ_PROJECT_ID: ${{ secrets.TEST_BQ_PROJECT_ID }}
E2E_BQ_PROJECT_ID2: ${{ secrets.TEST_BQ_PROJECT_ID2 }}
E2E_BQ_PRIVATE_KEY: ${{ secrets.TEST_BQ_PRIVATE_KEY_E2E }}
E2E_BQ_PRIVATE_KEY_ID: ${{ secrets.TEST_BQ_PRIVATE_KEY_ID }}
E2E_BQ_CLIENT_EMAIL: ${{ secrets.TEST_BQ_CLIENT_EMAIL }}
run: |
source env/bin/activate
cd ingestion
mkdir -p junit
pytest -v \
--e2e-contract-check \
-n 6 \
--junitxml="junit/test-results-v2-${E2E_CONNECTOR}.xml" \
"tests/cli_e2e_v2/${E2E_CONNECTOR}"
shell: bash
- name: Run Snowflake CLI E2E v2 tests
id: e2e-v2-snowflake-test
if: matrix.connector == 'snowflake'
env:
OM_ADMIN_EMAIL: admin@open-metadata.org
OM_ADMIN_PASSWORD: admin
# The same key-pair identity and E2E database the v1 Snowflake job uses. The job's
# concurrency group keeps the two from overlapping.
E2E_SNOWFLAKE_ACCOUNT: ${{ secrets.TEST_SNOWFLAKE_ACCOUNT }}
E2E_SNOWFLAKE_USERNAME: ${{ secrets.TEST_SNOWFLAKE_USERNAME }}
E2E_SNOWFLAKE_PRIVATE_KEY: ${{ secrets.TEST_SNOWFLAKE_PASSWORD_YAML }}
E2E_SNOWFLAKE_PASSPHRASE: ${{ secrets.TEST_SNOWFLAKE_PASSPHRASE }}
E2E_SNOWFLAKE_WAREHOUSE: ${{ secrets.TEST_SNOWFLAKE_WAREHOUSE }}
E2E_SNOWFLAKE_DATABASE: ${{ secrets.TEST_SNOWFLAKE_DATABASE_E2E }}
run: |
source env/bin/activate
cd ingestion
mkdir -p junit
pytest -v \
--e2e-contract-check \
-n 4 \
--junitxml="junit/test-results-v2-${E2E_CONNECTOR}.xml" \
"tests/cli_e2e_v2/${E2E_CONNECTOR}"
shell: bash
- name: Upload tests artifact
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: tests-v2-${{ matrix.connector }}
path: ingestion/junit/test-results-v2-*.xml
- name: Clean Up
if: always()
run: |
cd ./docker/development
docker compose down --remove-orphans
sudo rm -rf "${PWD}/docker-volume"