Repository navigation
489 lines (421 loc) · 17.9 KB
/
Copy pathintegration.yml
File metadata and controls
489 lines (421 loc) · 17.9 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
name: Integration Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
# Non-PR runs get a unique suffix so queued main runs are retained too.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event_name == 'pull_request' && 'pr' || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
postgres-integration:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: sqlctx_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust compilation
id: rust-cache
uses: ./.github/actions/setup-rust-cache
with:
suffix: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index || 0 }}
- name: Install uv
id: uv
uses: ./.github/actions/setup-uv
with:
enable-cache: true
suffix: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index || 0 }}
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --extra postgres --extra dev --extra rust
- name: Run PostgreSQL integration tests
env:
POSTGRES_TEST: "1"
POSTGRES_URL: "postgres://test:test@localhost:5432/sqlctx_test"
POSTGRES_HOST: "localhost"
POSTGRES_PORT: "5432"
POSTGRES_DB: "sqlctx_test"
POSTGRES_USER: "test"
POSTGRES_PASSWORD: "test"
run: |
uv run pytest --test-engine python -m integration tests/db/test_postgres_integration.py -v
uv run pytest --test-engine rust -m integration tests/db/test_postgres_integration.py -v
- name: Run PostgreSQL CLI e2e test
env:
POSTGRES_TEST: "1"
POSTGRES_HOST: "localhost"
POSTGRES_PORT: "5432"
POSTGRES_DB: "sqlctx_test"
POSTGRES_USER: "test"
POSTGRES_PASSWORD: "test"
run: |
uv run pytest --test-engine python -m integration tests/db/test_postgres_cli_e2e.py -v
uv run pytest --test-engine rust -m integration tests/db/test_postgres_cli_e2e.py -v
# The suite parametrizes Python, public Rust (no fallback), and native Rust import/compile.
- name: Run Ossie on real PostgreSQL and DuckDB
env:
POSTGRES_URL: "postgres://test:test@localhost:5432/sqlctx_test"
run: |
OSSIE_INTEGRATION_BACKEND=duckdb uv run pytest -m integration tests/db/test_ossie_integration.py -v
OSSIE_INTEGRATION_BACKEND=postgres uv run pytest -m integration tests/db/test_ossie_integration.py -v
- name: Save completed build caches
if: ${{ !cancelled() }}
uses: ./.github/actions/save-build-caches
with:
rust-key: ${{ steps.rust-cache.outputs.key }}
uv-key: ${{ steps.uv.outputs.cache-key }}
bigquery-integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust compilation
id: rust-cache
uses: ./.github/actions/setup-rust-cache
with:
suffix: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index || 0 }}
- name: Start BigQuery emulator
run: |
docker run -d --name bigquery-emulator \
-p 9050:9050 \
ghcr.io/goccy/bigquery-emulator:0.8.1 \
--project=test-project --dataset=test_dataset
# Require a responding emulator before executing database assertions.
for attempt in {1..30}; do
if curl --fail --silent http://localhost:9050/bigquery/v2/projects/test-project/datasets > /dev/null; then
exit 0
fi
sleep 1
done
docker logs bigquery-emulator
exit 1
- name: Install uv
id: uv
uses: ./.github/actions/setup-uv
with:
enable-cache: true
suffix: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index || 0 }}
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --extra bigquery --extra dev --extra rust
- name: Run BigQuery integration tests
env:
BIGQUERY_TEST: "1"
BIGQUERY_EMULATOR_HOST: "localhost:9050"
BIGQUERY_PROJECT: "test-project"
BIGQUERY_DATASET: "test_dataset"
run: |
uv run pytest --test-engine python -m integration tests/db/test_bigquery_integration.py -v
uv run pytest --test-engine rust -m integration tests/db/test_bigquery_integration.py -v
# The suite parametrizes Python, public Rust (no fallback), and native Rust import/compile.
- name: Run Ossie on BigQuery emulator (not live cloud)
env:
OSSIE_INTEGRATION_BACKEND: "bigquery"
BIGQUERY_EMULATOR_HOST: "localhost:9050"
BIGQUERY_PROJECT: "test-project"
BIGQUERY_DATASET: "test_dataset"
run: |
# The emulator retains a bounded WASM heap. Isolate each compiler
# route from earlier suites without skipping any route's SQL assertions.
for ossie_route in python public_rust native_rust; do
docker restart bigquery-emulator
for attempt in {1..30}; do
if curl --fail --silent http://localhost:9050/bigquery/v2/projects/test-project/datasets > /dev/null; then
break
fi
sleep 1
done
curl --fail --silent http://localhost:9050/bigquery/v2/projects/test-project/datasets > /dev/null
uv run pytest -m integration tests/db/test_ossie_integration.py -k "$ossie_route" -v
done
- name: Save completed build caches
if: ${{ !cancelled() }}
uses: ./.github/actions/save-build-caches
with:
rust-key: ${{ steps.rust-cache.outputs.key }}
uv-key: ${{ steps.uv.outputs.cache-key }}
snowflake-integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust compilation
id: rust-cache
uses: ./.github/actions/setup-rust-cache
with:
suffix: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index || 0 }}
- name: Install uv
id: uv
uses: ./.github/actions/setup-uv
with:
enable-cache: true
suffix: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index || 0 }}
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --extra snowflake --extra dev --extra rust
- name: Run Snowflake integration tests
env:
SNOWFLAKE_TEST: "1"
run: |
# Resolve fakesnow with its compatible SQLGlot version on every run;
# a preceding uv pip install is undone by the locked project sync.
uv run --with "fakesnow==0.11.11" pytest --test-engine python -m integration tests/db/test_snowflake_integration.py -v
uv run --with "fakesnow==0.11.11" pytest --test-engine rust -m integration tests/db/test_snowflake_integration.py -v
# The suite parametrizes Python, public Rust (no fallback), and native Rust import/compile.
- name: Run Ossie on fakesnow emulator (not live Snowflake)
env:
OSSIE_INTEGRATION_BACKEND: "snowflake"
run: |
uv run --with "fakesnow==0.11.11" pytest -m integration tests/db/test_ossie_integration.py -v
- name: Save completed build caches
if: ${{ !cancelled() }}
uses: ./.github/actions/save-build-caches
with:
rust-key: ${{ steps.rust-cache.outputs.key }}
uv-key: ${{ steps.uv.outputs.cache-key }}
clickhouse-integration:
runs-on: ubuntu-latest
services:
clickhouse:
image: clickhouse/clickhouse-server:25.8.28.1-alpine
env:
CLICKHOUSE_DB: default
CLICKHOUSE_USER: default
CLICKHOUSE_PASSWORD: clickhouse
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
ports:
- 8123:8123
options: >-
--health-cmd "clickhouse-client --user default --password clickhouse --query 'SELECT 1'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust compilation
id: rust-cache
uses: ./.github/actions/setup-rust-cache
with:
suffix: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index || 0 }}
- name: Install uv
id: uv
uses: ./.github/actions/setup-uv
with:
enable-cache: true
suffix: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index || 0 }}
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --extra clickhouse --extra dev --extra rust
- name: Run ClickHouse integration tests
env:
CLICKHOUSE_TEST: "1"
CLICKHOUSE_HOST: "localhost"
CLICKHOUSE_PORT: "8123"
CLICKHOUSE_PASSWORD: "clickhouse"
run: |
uv run pytest --test-engine python -m integration tests/db/test_clickhouse_integration.py -v
uv run pytest --test-engine rust -m integration tests/db/test_clickhouse_integration.py -v
# The suite parametrizes Python, public Rust (no fallback), and native Rust import/compile.
- name: Run Ossie on real ClickHouse
env:
OSSIE_INTEGRATION_BACKEND: "clickhouse"
CLICKHOUSE_HOST: "localhost"
CLICKHOUSE_PORT: "8123"
CLICKHOUSE_PASSWORD: "clickhouse"
run: |
uv run pytest -m integration tests/db/test_ossie_integration.py -v
- name: Save completed build caches
if: ${{ !cancelled() }}
uses: ./.github/actions/save-build-caches
with:
rust-key: ${{ steps.rust-cache.outputs.key }}
uv-key: ${{ steps.uv.outputs.cache-key }}
adbc-integration:
name: ADBC integration (${{ matrix.db }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
db: [sqlite, duckdb, postgres, bigquery, snowflake, clickhouse]
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: sqlctx_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
clickhouse:
image: clickhouse/clickhouse-server:25.8.28.1-alpine
env:
CLICKHOUSE_DB: default
CLICKHOUSE_USER: default
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
ports:
- 8123:8123
options: >-
--health-cmd "clickhouse-client --user default --query 'SELECT 1'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install Rust for Rust ADBC probe
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust compilation
id: rust-cache
uses: ./.github/actions/setup-rust-cache
with:
suffix: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index || 0 }}
- name: Start BigQuery emulator
if: matrix.db == 'bigquery'
run: |
docker run -d --name bigquery-emulator \
-p 9050:9050 \
ghcr.io/goccy/bigquery-emulator:0.8.1 \
--project=test-project --dataset=test_dataset
sleep 5
- name: Install uv
id: uv
uses: ./.github/actions/setup-uv
with:
enable-cache: true
suffix: ${{ github.workflow }}-${{ github.job }}-${{ strategy.job-index || 0 }}
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --extra dev --extra adbc --extra rust
- name: Install ADBC driver through dbc
run: |
DRIVER_DIR="$HOME/.config/adbc/drivers"
echo "ADBC_DRIVER_PATH=$DRIVER_DIR" >> "$GITHUB_ENV"
DB="${{ matrix.db }}"
DRIVER="$DB"
if [ "$DB" = "postgres" ]; then
DRIVER="postgresql"
fi
if [ "$DB" = "clickhouse" ]; then
uv run --with dbc dbc install --level user --pre clickhouse
uv run --with dbc dbc list --level user
exit 0
fi
uv run --with dbc dbc install --level user "$DRIVER"
uv run --with dbc dbc list --level user
- name: Run Python ADBC smoke tests
if: matrix.db != 'sqlite' && matrix.db != 'duckdb'
env:
ADBC_TEST: "1"
ADBC_DB: ${{ matrix.db }}
POSTGRES_URL: "postgres://test:test@localhost:5432/sqlctx_test"
BIGQUERY_EMULATOR_HOST: "localhost:9050"
BIGQUERY_PROJECT: "test-project"
BIGQUERY_DATASET: "test_dataset"
CLICKHOUSE_HOST: "localhost"
CLICKHOUSE_PORT: "8123"
SNOWFLAKE_TEST: "1"
run: |
uv run pytest --test-engine python -m integration tests/db/test_adbc_ci_smoke.py -v
uv run pytest --test-engine rust -m integration tests/db/test_adbc_ci_smoke.py -v
- name: Export SQLite ADBC driver for Rust
if: matrix.db == 'sqlite'
run: |
echo "SQLCTX_TEST_ADBC_SQLITE_DRIVER=sqlite" >> "$GITHUB_ENV"
echo "SQLCTX_TEST_ADBC_SQLITE_URI=:memory:" >> "$GITHUB_ENV"
echo "SQLCTX_TEST_ADBC_REQUIRE=sqlite" >> "$GITHUB_ENV"
- name: Export DuckDB ADBC driver for Rust
if: matrix.db == 'duckdb'
run: |
echo "SQLCTX_TEST_ADBC_DUCKDB_DRIVER=duckdb" >> "$GITHUB_ENV"
echo "SQLCTX_TEST_ADBC_REQUIRE=duckdb" >> "$GITHUB_ENV"
- name: Export Postgres ADBC driver for Rust
if: matrix.db == 'postgres'
run: |
echo "SQLCTX_TEST_ADBC_POSTGRES_DRIVER=postgresql" >> "$GITHUB_ENV"
echo "SQLCTX_TEST_ADBC_POSTGRES_URI=postgresql://test:test@localhost:5432/sqlctx_test" >> "$GITHUB_ENV"
echo "SQLCTX_TEST_ADBC_REQUIRE=postgres" >> "$GITHUB_ENV"
- name: Export BigQuery ADBC driver for Rust
if: matrix.db == 'bigquery'
env:
BIGQUERY_ADBC_CREDENTIALS_JSON: ${{ secrets.BIGQUERY_ADBC_CREDENTIALS_JSON }}
BIGQUERY_ADBC_PROJECT: ${{ vars.BIGQUERY_ADBC_PROJECT }}
BIGQUERY_ADBC_DATASET: ${{ vars.BIGQUERY_ADBC_DATASET }}
run: |
if [ -z "$BIGQUERY_ADBC_CREDENTIALS_JSON" ] || [ -z "$BIGQUERY_ADBC_PROJECT" ] || [ -z "$BIGQUERY_ADBC_DATASET" ]; then
echo "Skipping Rust BigQuery ADBC probe; BIGQUERY_ADBC_CREDENTIALS_JSON secret plus BIGQUERY_ADBC_PROJECT/BIGQUERY_ADBC_DATASET vars are required."
exit 0
fi
CREDENTIALS_FILE="$(mktemp)"
printf '%s' "$BIGQUERY_ADBC_CREDENTIALS_JSON" > "$CREDENTIALS_FILE"
echo "::add-mask::$BIGQUERY_ADBC_CREDENTIALS_JSON"
echo "SQLCTX_TEST_ADBC_BIGQUERY_DRIVER=bigquery" >> "$GITHUB_ENV"
echo "SQLCTX_TEST_ADBC_BIGQUERY_DBOPTS=adbc.bigquery.sql.project_id=$BIGQUERY_ADBC_PROJECT,adbc.bigquery.sql.dataset_id=$BIGQUERY_ADBC_DATASET,adbc.bigquery.sql.auth_type=adbc.bigquery.sql.auth_type.json_credential_file,adbc.bigquery.sql.auth_credentials=$CREDENTIALS_FILE" >> "$GITHUB_ENV"
echo "SQLCTX_TEST_ADBC_REQUIRE=bigquery" >> "$GITHUB_ENV"
- name: Export Snowflake ADBC driver for Rust
if: matrix.db == 'snowflake'
env:
SNOWFLAKE_ADBC_URI: ${{ secrets.SNOWFLAKE_ADBC_URI }}
run: |
if [ -z "$SNOWFLAKE_ADBC_URI" ]; then
echo "Skipping Rust Snowflake ADBC probe; SNOWFLAKE_ADBC_URI secret is required."
exit 0
fi
echo "::add-mask::$SNOWFLAKE_ADBC_URI"
echo "SQLCTX_TEST_ADBC_SNOWFLAKE_DRIVER=snowflake" >> "$GITHUB_ENV"
echo "SQLCTX_TEST_ADBC_SNOWFLAKE_URI=$SNOWFLAKE_ADBC_URI" >> "$GITHUB_ENV"
echo "SQLCTX_TEST_ADBC_REQUIRE=snowflake" >> "$GITHUB_ENV"
- name: Export ClickHouse ADBC driver for Rust
if: matrix.db == 'clickhouse'
run: |
echo "SQLCTX_TEST_ADBC_CLICKHOUSE_DRIVER=clickhouse" >> "$GITHUB_ENV"
echo "SQLCTX_TEST_ADBC_CLICKHOUSE_URI=http://localhost:8123/" >> "$GITHUB_ENV"
echo "SQLCTX_TEST_ADBC_REQUIRE=clickhouse" >> "$GITHUB_ENV"
- name: Run Rust ADBC semantic smoke
env:
SQLCTX_ADBC_TESTS: "1"
SQLCTX_ADBC_DB: ${{ matrix.db }}
SQLCTX_ADBC_REQUIRED: ${{ contains(fromJSON('["sqlite","duckdb","postgres","clickhouse"]'), matrix.db) }}
POSTGRES_URL: "postgres://test:test@localhost:5432/sqlctx_test"
BIGQUERY_EMULATOR_HOST: "localhost:9050"
BIGQUERY_PROJECT: "test-project"
BIGQUERY_DATASET: "test_dataset"
CLICKHOUSE_URL: "adbc://clickhouse?uri=http://localhost:8123/"
SNOWFLAKE_TEST: "1"
RUST_MIN_STACK: 16777216
run: cargo test --manifest-path sqlctx-rs/Cargo.toml --features adbc-exec --test adbc_engines -- --nocapture
- name: Run Rust ADBC probe
run: cargo test --manifest-path sqlctx-rs/Cargo.toml --features adbc-exec --test adbc_driver_matrix
- name: Save completed build caches
if: ${{ !cancelled() }}
uses: ./.github/actions/save-build-caches
with:
rust-key: ${{ steps.rust-cache.outputs.key }}
uv-key: ${{ steps.uv.outputs.cache-key }}