feat(smoke-test): select pytest smoke tests by backend capability
Smoke tests can now run against the Docker quickstart (default) or the Docker-free local stack (datahub-dev.sh start --local).
requires(...)marker andutilities/backends.py/backend_plugin.py:SMOKE_BACKEND=localdeselects tests needing Kafka, the SQL database, the docker CLI, the Play frontend or object storage;SMOKE_BACKEND_MODE=canaryruns only those (plusdocker_canary) on Docker.- Batch plans record the backend; a batch job run with a different backend stops.
- Kafka/SQL test helpers fail fast with the marker to add when the backend lacks the capability.
.github/scripts/check_backend_markers.py: static lint (pre-commit + smoke-test-lint) for modules that use Kafka/SQL/docker without a marker.- CI:
SMOKE_BACKEND=dockeron the pytest plan and batch steps; the GMS-lite local-stack workflow runs its smoke tests withSMOKE_BACKEND=localand checks the lane selection. - Tests read ES URL, usage index, index prefix and frontend URL from env, so they also run on the Docker-free stack.
- Markers from a full run on the Docker-free stack:
requires(play_frontend)onmcp/mcp_test.pyand the two Bearer-token tests intest_authentication_e2e.py;requires(kafka)on the actions doc/term propagation modules (no actions process locally);test_queue_ingest_usage.pyneeds onlykafka. - The analytics backfill writes to
ELASTICSEARCH_INDEX, so it honours the local stack's index prefix.
No behaviour change when SMOKE_BACKEND is unset (defaults to docker, every test selected).
Ported from the fork: bf8f597ae85, 1925b3b8a27, a869b8017bd, 435dba1da41, and marker parts of 73f4a580589.
- The PR conforms to DataHub's Contributing Guideline (particularly PR Title Format)
- Links to related issues (if applicable)
- Tests for the changes have been added/updated (
tests/unit/test_backend_plugin.py,test_check_backend_markers.py,test_batch_plan_dump.py) - Docs related to the changes have been added/updated (
smoke-test/AGENTS.md,smoke-test/README.md) - For any breaking change/potential downtime/deprecation/big changes an entry has been made in Breaking Changes ā none
š¤ Generated with Claude Code
Summary by cubic
Smoke tests can now run on the Docker-free local stack (datahub-dev.sh start --local) as well as the Docker quickstart. Tests declare the backend capabilities they need with a requires(...) marker; SMOKE_BACKEND=local deselects tests that need Kafka, the SQL database, the docker CLI, the Play frontend, object storage, or the executor image, and SMOKE_BACKEND_MODE=canary runs only those tests on Docker.
No behavior change when SMOKE_BACKEND is unset: it defaults to docker and every test is selected.
Selection and markers
- New
Capabilityenum and selection logic inutilities/backends.py; a pytest plugin deselects tests the configured backend cannot run. - Markers sit on the tests that genuinely need the capability: only the Bearer-token auth and MCP tests require
play_frontend, and the actions propagation tests requirekafkabecause the local stack runs no actions process. - Kafka and SQL helpers in
tests/e2e/utils.pyfail fast naming the missingrequires(...)marker on the local stack. - Unknown capability names and
SMOKE_BACKEND_MODE=canarywithoutSMOKE_BACKEND=dockerfail collection with a usage error. - Tests read the ES URL, usage index, index prefix, and frontend URL from env, so they also run on the Docker-free stack.
CI and guardrails
- New lint script
.github/scripts/check_backend_markers.pyflags modules that use Kafka, SQL, or the docker CLI without a marker; wired into pre-commit andsmoke-test-lint. - Batch plans record the backend, and a batch job run with a different backend stops instead of running the wrong selection.
- The GMS-lite local-stack workflow runs its smoke tests with
SMOKE_BACKEND=localand verifies the lane selection. - CI sets
SMOKE_BACKEND=dockeron the pytest plan and batch steps.