Skip to content

Commit 6a5a818

Browse files
rusackasSuperset Devclaudedependabot[bot]Milad93R
committed
feat(ci): add nightly-only opt-out for heavy testcontainers dialects (#43662)
Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: hainenber <dotronghai96@gmail.com> Signed-off-by: Gabriel Torres Ruiz <gabo2595@gmail.com> Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Superset Dev <dev@superset.apache.org> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Milad Rashidikhah <mrashidikhah32@gmail.com> Co-authored-by: bucketbase26 <singhayush062006@gmail.com> Co-authored-by: Joe Li <joe@preset.io> Co-authored-by: Viktor Högberg <119532259+vhogberg@users.noreply.github.com> Co-authored-by: joey <97154801+chkang83@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Chandan P <95340276+NoiceHax@users.noreply.github.com> Co-authored-by: Mafi <matt.fitzgerald@gmail.com> Co-authored-by: Matt Fitzgerald <matt.fitzgerald@preset.io> Co-authored-by: Enzo Martellucci <52219496+EnxDev@users.noreply.github.com> Co-authored-by: Alexandru Soare <37236580+alexandrusoare@users.noreply.github.com> Co-authored-by: Mehmet Salih Yavuz <salih.yavuz@proton.me> Co-authored-by: Sanmitra Nagaraj <48400413+s1ny1998@users.noreply.github.com> Co-authored-by: Lalith Kothuru <lalith.kothuru@gmail.com> Co-authored-by: shaurya <shauryajaiswal.dev@gmail.com> Co-authored-by: Shaurya <19599684+no-hup@users.noreply.github.com> Co-authored-by: Đỗ Trọng Hải <41283691+hainenber@users.noreply.github.com> Co-authored-by: rlei <242280117+rlei-odes@users.noreply.github.com> Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Co-authored-by: Gabriel Torres Ruiz <gabo2595@gmail.com> Co-authored-by: hainenber <dotronghai96@gmail.com> Co-authored-by: ʈᵃᵢ <tai@apache.org> Co-authored-by: Mike Bridge <michael.bridge@preset.io> Co-authored-by: Elizabeth Thompson <eschutho@gmail.com> Co-authored-by: Francesco.Castaldi <info@francescocastaldi.it> Co-authored-by: FrancescoCastaldi <francesco.castaldi@mapsgroup.it> Co-authored-by: Abdul Rehman <76230556+Abdulrehman-PIAIC80387@users.noreply.github.com> Co-authored-by: Sepuri Sai Krishna <saik20533@gmail.com> Co-authored-by: Mallikarjuna Reddy Nimmakayala <mallikarjunareddy.nimmakayala@gmail.com> Co-authored-by: PRATHAMESH HUKKERI <prathamhukkeri04@gmail.com> Co-authored-by: Prathamesh Hukkeri <prathamesh04@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: SBIN2010 <Sbin2010@mail.ru>
1 parent f535c47 commit 6a5a818

8 files changed

Lines changed: 920 additions & 48 deletions

File tree

‎.github/workflows/testcontainers.yml‎

Lines changed: 93 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ name: Testcontainers
99
# just from Superset's changes) and on pull_request, scoped via `paths` to
1010
# only PRs that actually touch this test suite or the workflow itself, so
1111
# unrelated PRs across the repo are never affected.
12+
#
13+
# A matrix entry can set `nightly_only: true` to run only on the cron (or a
14+
# manual workflow_dispatch), never on pull_request -- for a dialect whose
15+
# image is too heavy (a multi-service cluster, a many-GB image, a slow
16+
# licensed installer) to justify adding its wall-clock/resource cost to
17+
# every PR that merely touches this suite. Omit the field entirely for a
18+
# normal dialect; it isn't nightly-only by default.
1219
permissions:
1320
contents: read
1421

@@ -33,13 +40,22 @@ concurrency:
3340
cancel-in-progress: true
3441

3542
jobs:
36-
testcontainers:
43+
compute-matrix:
44+
# Filters out `nightly_only` dialects for a pull_request run *before* any
45+
# testcontainers job is created for them, so a heavy dialect costs a PR
46+
# nothing at all -- not even its checkout/setup/driver-install steps --
47+
# rather than being merely skipped at the test step. A job-level `if:`
48+
# can't reference `matrix` (only github/inputs/needs/vars are available
49+
# there), so the filtering has to happen here, before the matrix exists,
50+
# instead of on the testcontainers job itself.
3751
runs-on: ubuntu-26.04
38-
strategy:
39-
fail-fast: false
40-
matrix:
41-
include:
42-
# One job per dialect rather than one job for the whole suite: a
52+
outputs:
53+
include: ${{ steps.filter.outputs.include }}
54+
steps:
55+
- name: Filter nightly-only dialects
56+
id: filter
57+
env:
58+
# One entry per dialect rather than one job for the whole suite: a
4359
# single slow container would otherwise inflate the wall-clock
4460
# time for every dialect, not just its own. Running in parallel
4561
# means the suite's total time is bounded by the slowest dialect,
@@ -48,41 +64,45 @@ jobs:
4864
# process start) and untested locally here (no arm64 image), so
4965
# it gets a wider timeout margin than the rest until real CI data
5066
# says otherwise.
51-
- dialect: cockroachdb
52-
timeout: 10
53-
- dialect: crate
54-
timeout: 10
55-
- dialect: trino
56-
timeout: 10
57-
- dialect: mssql
58-
timeout: 10
59-
- dialect: elasticsearch
60-
timeout: 10
61-
- dialect: oracle
62-
timeout: 15
63-
- dialect: db2
64-
timeout: 25
65-
- dialect: mariadb
66-
timeout: 10
67-
- dialect: timescaledb
68-
timeout: 10
69-
- dialect: yugabytedb
70-
timeout: 10
71-
- dialect: monetdb
72-
timeout: 10
73-
- dialect: mongodb
74-
timeout: 10
75-
- dialect: postgres
76-
timeout: 10
77-
- dialect: mysql
78-
timeout: 10
79-
- dialect: clickhouse
80-
timeout: 10
81-
# StarRocks' allin1-ubuntu image brings up both FE and BE in one
82-
# container, which is a heavier bring-up than a single-process
83-
# database -- wider margin until real CI data says otherwise.
84-
- dialect: starrocks
85-
timeout: 15
67+
FULL_MATRIX: |
68+
[
69+
{"dialect": "cockroachdb", "timeout": 10},
70+
{"dialect": "crate", "timeout": 10},
71+
{"dialect": "trino", "timeout": 10},
72+
{"dialect": "mssql", "timeout": 10},
73+
{"dialect": "elasticsearch", "timeout": 10},
74+
{"dialect": "oracle", "timeout": 15},
75+
{"dialect": "db2", "timeout": 25},
76+
{"dialect": "mariadb", "timeout": 10},
77+
{"dialect": "timescaledb", "timeout": 10},
78+
{"dialect": "yugabytedb", "timeout": 10},
79+
{"dialect": "monetdb", "timeout": 10},
80+
{"dialect": "mongodb", "timeout": 10},
81+
{"dialect": "postgres", "timeout": 10},
82+
{"dialect": "mysql", "timeout": 10},
83+
{"dialect": "clickhouse", "timeout": 10},
84+
{"dialect": "starrocks", "timeout": 15},
85+
{"dialect": "databend", "timeout": 10},
86+
{"dialect": "risingwave", "timeout": 10},
87+
{"dialect": "firebird", "timeout": 10},
88+
{"dialect": "ydb", "timeout": 10},
89+
{"dialect": "oceanbase", "timeout": 20, "nightly_only": true}
90+
]
91+
run: |
92+
if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
93+
include="$(jq -c '.' <<<"$FULL_MATRIX")"
94+
else
95+
include="$(jq -c '[.[] | select(.nightly_only != true)]' <<<"$FULL_MATRIX")"
96+
fi
97+
echo "include=${include}" >> "$GITHUB_OUTPUT"
98+
99+
testcontainers:
100+
needs: [compute-matrix]
101+
runs-on: ubuntu-26.04
102+
strategy:
103+
fail-fast: false
104+
matrix:
105+
include: ${{ fromJson(needs.compute-matrix.outputs.include) }}
86106
timeout-minutes: ${{ matrix.timeout }}
87107
env:
88108
PYTHONPATH: ${{ github.workspace }}
@@ -109,7 +129,39 @@ jobs:
109129
# instead, only for this leg of the matrix.
110130
if: matrix.dialect == 'db2'
111131
run: uv pip install --system -e .[db2]
132+
- name: Install oceanbase driver (oceanbase_py)
133+
# oceanbase_py pins sqlalchemy-utils>=0.38.3,<0.39, which conflicts
134+
# outright with Superset's own sqlalchemy-utils==0.42.1 pin -- kept
135+
# out of the baseline dev install for the same reason as db2 above.
136+
# Installed as its own standalone package (not via `-e .[oceanbase]`)
137+
# so --no-deps only skips *oceanbase_py's* dependencies -- applied
138+
# to `-e .[oceanbase]` instead, --no-deps blocks pip from installing
139+
# anything the extras marker pulls in, including oceanbase_py
140+
# itself, which "succeeds" without actually installing it
141+
# (confirmed on real CI: the install step reported success, but the
142+
# module was still missing). This job only needs oceanbase_py's
143+
# dialect module importable, not its sqlalchemy-utils dependency
144+
# satisfied, since nothing here calls into it.
145+
if: >-
146+
matrix.dialect == 'oceanbase' &&
147+
(matrix.nightly_only != true ||
148+
github.event_name == 'schedule' ||
149+
github.event_name == 'workflow_dispatch')
150+
run: uv pip install --system --no-deps "oceanbase_py>=0.0.1.2"
151+
- name: Install Firebird client library (libfbclient2)
152+
# sqlalchemy-firebird's driver (firebird-driver) is a pure-Python
153+
# ctypes wrapper (its wheel is py3-none-any) that dynamically loads
154+
# the native Firebird client library from the host at import time
155+
# -- it doesn't bundle that library itself, so it has to come from
156+
# the system package manager, only for this leg of the matrix.
157+
if: matrix.dialect == 'firebird'
158+
run: |
159+
sudo apt-get update
160+
sudo apt-get install -y libfbclient2
112161
- name: Run testcontainers db_engine_specs tests (${{ matrix.dialect }})
162+
# nightly_only dialects are already excluded from the matrix itself
163+
# on pull_request runs (see the compute-matrix job above), so this
164+
# step needs no additional gating.
113165
run: |
114166
pytest --durations-min=2 -v -m testcontainers \
115167
./tests/testcontainers/db_engine_specs/test_${{ matrix.dialect }}.py \

‎requirements/development.in‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,20 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
#
19-
-e .[development,bigquery,clickhouse,cockroachdb,crate,druid,duckdb,elasticsearch,fastmcp,gevent,gsheets,monetdb,mongodb,mssql,mysql,oracle,postgres,presto,prophet,starrocks,trino,thumbnails]
19+
-e .[development,bigquery,clickhouse,cockroachdb,crate,databend,druid,duckdb,elasticsearch,fastmcp,firebird,gevent,gsheets,monetdb,mongodb,mssql,mysql,oracle,postgres,presto,prophet,risingwave,starrocks,trino,thumbnails,ydb]
2020
-e ./superset-extensions-cli[test]
2121
# testcontainers-backed db_engine_specs tests (tests/testcontainers/) --
2222
# see .github/workflows/testcontainers.yml
2323
#
24-
# `db2` (the `ibm-db-sa`/`ibm-db` driver) is deliberately left out of the
25-
# baseline dev install above: `ibm-db` ships no Linux arm64 wheel, so
26-
# including it here breaks the multi-platform (amd64+arm64) dev Docker
27-
# image build. The testcontainers CI job installs it on demand, only for
28-
# the db2 matrix leg -- see .github/workflows/testcontainers.yml.
24+
# `db2` (the `ibm-db-sa`/`ibm-db` driver) and `oceanbase` (the `oceanbase_py`
25+
# driver) are both deliberately left out of the baseline dev install above:
26+
# `ibm-db` ships no Linux arm64 wheel, breaking the multi-platform
27+
# (amd64+arm64) dev Docker image build; `oceanbase_py` pins
28+
# `sqlalchemy-utils>=0.38.3,<0.39`, which conflicts outright with Superset's
29+
# own `sqlalchemy-utils==0.42.1` pin -- there's no version of both that can
30+
# coexist in one resolved environment. Both testcontainers CI jobs install
31+
# their driver on demand instead, only for their own matrix leg -- see
32+
# .github/workflows/testcontainers.yml.
2933
#
3034
# mariadb/timescaledb/yugabytedb need no testcontainers extra of their own:
3135
# they reuse the postgres/mysql container classes pointed at a different
@@ -36,5 +40,8 @@
3640
# pulled in above via the clickhouse extra, is all the test needs), and
3741
# StarRocks has no dedicated testcontainers module at all -- its test uses
3842
# a generic DockerContainer plus the same mysqlclient the mysql extra
39-
# already provides.
43+
# already provides. databend/risingwave/firebird/ydb are the same story:
44+
# none has a dedicated testcontainers module, so each test uses a generic
45+
# DockerContainer plus whatever driver its own extra above already
46+
# provides.
4047
testcontainers[cockroachdb,cratedb,mongodb,mssql,mysql,oracle,postgres,trino]>=4.15.0,<5

‎requirements/development.txt‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
# apache-superset
1313
aiofile==3.9.0
1414
# via py-key-value-aio
15+
aiohappyeyeballs==2.7.1
16+
# via aiohttp
17+
aiohttp==3.14.3
18+
# via ydb
19+
aiosignal==1.4.0
20+
# via aiohttp
1521
alembic==1.15.2
1622
# via
1723
# -c requirements/base-constraint.txt
@@ -50,6 +56,7 @@ asyncmy2==0.2.21
5056
attrs==25.3.0
5157
# via
5258
# -c requirements/base-constraint.txt
59+
# aiohttp
5360
# cattrs
5461
# cyclopts
5562
# jsonschema
@@ -209,6 +216,10 @@ cycler==0.12.1
209216
# via matplotlib
210217
cyclopts==4.2.4
211218
# via fastmcp-slim
219+
databend-driver==0.34.2
220+
# via databend-sqlalchemy
221+
databend-sqlalchemy==0.5.5
222+
# via apache-superset
212223
db-dtypes==1.3.1
213224
# via pandas-gbq
214225
defusedxml==0.7.1
@@ -271,6 +282,10 @@ filelock==3.20.3
271282
# via
272283
# -c requirements/base-constraint.txt
273284
# virtualenv
285+
firebird-base==2.0.3
286+
# via firebird-driver
287+
firebird-driver==2.0.3
288+
# via sqlalchemy-firebird
274289
flask==3.1.3
275290
# via
276291
# -c requirements/base-constraint.txt
@@ -351,6 +366,10 @@ fonttools==4.60.2
351366
# via matplotlib
352367
freezegun==1.5.1
353368
# via apache-superset
369+
frozenlist==1.8.0
370+
# via
371+
# aiohttp
372+
# aiosignal
354373
future==1.0.0
355374
# via pyhive
356375
geographiclib==2.0
@@ -415,6 +434,7 @@ grpcio==1.83.1
415434
# apache-superset
416435
# google-api-core
417436
# grpcio-status
437+
# ydb
418438
grpcio-status==1.60.1
419439
# via google-api-core
420440
gunicorn==26.2.0
@@ -457,6 +477,7 @@ idna==3.15
457477
# httpx
458478
# requests
459479
# url-normalize
480+
# yarl
460481
importlib-metadata==8.7.0
461482
# via
462483
# keyring
@@ -600,6 +621,10 @@ msgspec==0.19.0
600621
# via
601622
# -c requirements/base-constraint.txt
602623
# flask-session
624+
multidict==6.7.1
625+
# via
626+
# aiohttp
627+
# yarl
603628
mysqlclient==2.2.8
604629
# via apache-superset
605630
nh3==0.3.7
@@ -672,6 +697,8 @@ packaging==25.0
672697
# pytest
673698
# shillelagh
674699
# sqlalchemy-bigquery
700+
# sqlalchemy-firebird
701+
# ydb
675702
pandas==2.3.3
676703
# via
677704
# -c requirements/base-constraint.txt
@@ -733,16 +760,22 @@ prompt-toolkit==3.0.51
733760
# via
734761
# -c requirements/base-constraint.txt
735762
# click-repl
763+
propcache==0.5.2
764+
# via
765+
# aiohttp
766+
# yarl
736767
prophet==1.4.0
737768
# via apache-superset
738769
proto-plus==1.25.0
739770
# via google-api-core
740771
protobuf==5.29.6
741772
# via
773+
# firebird-base
742774
# google-api-core
743775
# googleapis-common-protos
744776
# grpcio-status
745777
# proto-plus
778+
# ydb
746779
psutil==6.1.0
747780
# via
748781
# apache-superset
@@ -878,6 +911,7 @@ python-dateutil==2.9.0.post0
878911
# botocore
879912
# celery
880913
# croniter
914+
# firebird-driver
881915
# flask-appbuilder
882916
# freezegun
883917
# google-cloud-bigquery
@@ -1017,6 +1051,7 @@ sqlalchemy==2.0.52
10171051
# alembic
10181052
# apache-superset
10191053
# apache-superset-core
1054+
# databend-sqlalchemy
10201055
# duckdb-engine
10211056
# elasticsearch-dbapi
10221057
# flask-appbuilder
@@ -1027,10 +1062,13 @@ sqlalchemy==2.0.52
10271062
# sqlalchemy-cockroachdb
10281063
# sqlalchemy-continuum
10291064
# sqlalchemy-cratedb
1065+
# sqlalchemy-firebird
10301066
# sqlalchemy-monetdb
1067+
# sqlalchemy-risingwave
10311068
# sqlalchemy-utils
10321069
# starrocks
10331070
# testcontainers
1071+
# ydb-sqlalchemy
10341072
sqlalchemy-bigquery==1.17.2
10351073
# via apache-superset
10361074
sqlalchemy-cockroachdb==2.0.4
@@ -1043,8 +1081,12 @@ sqlalchemy-cratedb==0.43.1
10431081
# via
10441082
# apache-superset
10451083
# testcontainers
1084+
sqlalchemy-firebird==2.2.0
1085+
# via apache-superset
10461086
sqlalchemy-monetdb==2.1.0
10471087
# via apache-superset
1088+
sqlalchemy-risingwave==2.1.0
1089+
# via apache-superset
10481090
sqlalchemy-utils==0.42.1
10491091
# via
10501092
# -c requirements/base-constraint.txt
@@ -1056,6 +1098,7 @@ sqlglot==30.17.0
10561098
# -c requirements/base-constraint.txt
10571099
# apache-superset
10581100
# apache-superset-core
1101+
# ydb-sqlglot-plugin
10591102
sqloxide==0.1.51
10601103
# via apache-superset
10611104
sse-starlette==3.0.2
@@ -1097,6 +1140,8 @@ trino==0.339.0
10971140
typing-extensions==4.16.0
10981141
# via
10991142
# -c requirements/base-constraint.txt
1143+
# aiohttp
1144+
# aiosignal
11001145
# alembic
11011146
# anyio
11021147
# apache-superset
@@ -1215,6 +1260,18 @@ xlsxwriter==3.2.9
12151260
# -c requirements/base-constraint.txt
12161261
# apache-superset
12171262
# pandas
1263+
yarl==1.24.5
1264+
# via aiohttp
1265+
ydb==3.31.4
1266+
# via
1267+
# ydb-dbapi
1268+
# ydb-sqlalchemy
1269+
ydb-dbapi==0.1.23
1270+
# via ydb-sqlalchemy
1271+
ydb-sqlalchemy==0.1.22
1272+
# via apache-superset
1273+
ydb-sqlglot-plugin==0.2.8
1274+
# via apache-superset
12181275
zipp==3.23.0
12191276
# via importlib-metadata
12201277
zope-event==5.0

0 commit comments

Comments
 (0)