mirror of
https://github.com/apache/superset.git
synced 2026-09-05 23:12:01 +00:00
fix(testcontainers): address reviewer feedback on cockroachdb DBAPI, CI isolation, and test rigor
- pyproject.toml: pin psycopg2-binary alongside sqlalchemy-cockroachdb -- the latter declares no DBAPI dependency of its own, so the documented `apache-superset[cockroachdb]` install couldn't actually connect. - testcontainers.yml: scope the concurrency group by ref so a PR run and the nightly cron (or two different PRs) no longer cancel each other. - test_cockroachdb.py: assert the actual generic/SQLAlchemy type, matching the Trino test, instead of only checking a column spec was found. - pytest.ini + new `testcontainers` marker + _driver.py: exclude tests/testcontainers/ from a plain `pytest` run by default (it needs Docker), while the dedicated CI job now sets SUPERSET_TESTCONTAINERS_STRICT so a broken/missing driver import fails that job instead of silently skipping to a green, zero-tests-run result. - UPDATING.md: the migration note now says to uninstall the old `cockroachdb` package outright, since reinstalling the extra alone can leave both packages registering the same dialect entry point. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
80928bdb6c
commit
ce94f79a09
@@ -22,7 +22,10 @@ on:
|
||||
- "tests/testcontainers/**"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
# Scoped by ref, not just workflow name -- otherwise every PR run and the
|
||||
# nightly cron share one group, and starting the workflow on another PR
|
||||
# (or the nightly firing mid-PR-run) cancels an unrelated in-progress run.
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
@@ -60,6 +63,11 @@ jobs:
|
||||
PYTHONPATH: ${{ github.workspace }}
|
||||
SUPERSET_TESTENV: true
|
||||
SUPERSET_SECRET_KEY: not-a-secret
|
||||
# This job's matrix installs exactly one dialect's testcontainers
|
||||
# driver for exactly this job, so treat that driver as required: a
|
||||
# broken/missing import should fail the job, not silently skip to a
|
||||
# misleadingly green, zero-tests-run result. See _driver.py.
|
||||
SUPERSET_TESTCONTAINERS_STRICT: true
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
@@ -71,7 +79,8 @@ jobs:
|
||||
python-version: current
|
||||
- name: Run testcontainers db_engine_specs tests (${{ matrix.dialect }})
|
||||
run: |
|
||||
pytest --durations-min=2 -v ./tests/testcontainers/db_engine_specs/test_${{ matrix.dialect }}.py \
|
||||
pytest --durations-min=2 -v -m testcontainers \
|
||||
./tests/testcontainers/db_engine_specs/test_${{ matrix.dialect }}.py \
|
||||
--junit-xml=test-results/junit-testcontainers-${{ matrix.dialect }}.xml
|
||||
- name: Upload JUnit test results
|
||||
if: always()
|
||||
|
||||
Reference in New Issue
Block a user