Skip to content

feat(smoke-test): select pytest smoke tests by backend capability - #21627

Merged
devashish2203 merged 2 commits into
masterfrom
test/p-pfp-1235-smoke-backend-selection
Nov 26, 2026
Merged

devashish2203 merged 2 commits into
masterfrom
test/p-pfp-1235-smoke-backend-selection

Conversation

@devashish2203

@devashish2203 devashish2203 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Smoke tests can now run against the Docker quickstart (default) or the Docker-free local stack (datahub-dev.sh start --local).

  • requires(...) marker and utilities/backends.py / backend_plugin.py: SMOKE_BACKEND=local deselects tests needing Kafka, the SQL database, the docker CLI, the Play frontend or object storage; SMOKE_BACKEND_MODE=canary runs only those (plus docker_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=docker on the pytest plan and batch steps; the GMS-lite local-stack workflow runs its smoke tests with SMOKE_BACKEND=local and 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) on mcp/mcp_test.py and the two Bearer-token tests in test_authentication_e2e.py; requires(kafka) on the actions doc/term propagation modules (no actions process locally); test_queue_ingest_usage.py needs only kafka.
  • 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 Capability enum and selection logic in utilities/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 require kafka because the local stack runs no actions process.
  • Kafka and SQL helpers in tests/e2e/utils.py fail fast naming the missing requires(...) marker on the local stack.
  • Unknown capability names and SMOKE_BACKEND_MODE=canary without SMOKE_BACKEND=docker fail 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.py flags modules that use Kafka, SQL, or the docker CLI without a marker; wired into pre-commit and smoke-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=local and verifies the lane selection.
  • CI sets SMOKE_BACKEND=docker on the pytest plan and batch steps.

Written for commit 17b34f9. Summary will update on new commits.

View guided diff Turn on auto-fix

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Summary

Overview
Smoke tests gain a backend capability model so the same suite can run on the Docker quickstart (default) or the Docker-free local stack without spurious failures.

A new requires(...) marker and pytest plugin backend_plugin deselect tests when SMOKE_BACKEND=local lacks Kafka, SQL DB, docker CLI, Play frontend, object storage, or similar. SMOKE_BACKEND_MODE=canary on Docker runs only those excluded tests plus docker_canary. Batch plans now record backend/mode; mismatched batch jobs exit instead of running the wrong selection. Kafka/SQL helpers in tests/e2e/utils.py call require_capability for fail-fast errors that name the missing marker.

Guardrails and CI: static lint check_backend_markers.py (pre-commit + smoke-test-lint) and check_local_lane_selection.sh on the GMS-lite workflow verify marker coverage and p0 lane splits. Docker CI sets SMOKE_BACKEND=docker on plan and batch steps; local-stack workflow uses SMOKE_BACKEND=local.

Existing modules are tagged with Capability.* where needed; several tests now read ES URL, index name, prefix, and frontend URL from env_vars so they work on both stacks. Unset SMOKE_BACKEND still defaults to docker with no selection change.

Reviewed by Cursor Bugbot for commit 17b34f9. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added devops PR or Issue related to DataHub backend & deployment smoke_test Contains changes related to smoke tests labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Smart test selection

pytest smoke tests

Mode: shadow. The selection below is computed but not applied; this PR still runs the default matrix (p0).

  • Selection: smart: tests for the tagged features, plus always-run modules, this PR's changed tests, and the plumbing sample if the PR changes the pytest harness
  • Size: 276 of 846 tests in 1 batch, predicted longest batch ~7 min
  • Tags: change-type: ci, docs, pytest-plumbing, test-infra, tooling; compound: propagation:docs, propagation:terms; feature-dev: authentication, stateful-ingestion, system-metadata; feature-user: analytics, documentation, glossary, ingestion; technical-layer: cli, kafka-events, openapi, restli
  • Confidence: MEDIUM (38 changed files)
  • Classifier reasoning: Mostly smoke-test harness and CI changes, plus requires() markers and env-var plumbing across e2e test modules that cover the listed features, transports and CLI/API surfaces.

Medium confidence: a wrong tag means tests are skipped, so check the tags above against what this PR touches.

Selected scopes (56 files or classes, 276 tests)
  • tests/e2e/actions/doc_propagation/test_propagation.py
  • tests/e2e/actions/term_propagation/test_term_propagation.py
  • tests/e2e/actions/test_actions_shutdown.py
  • tests/e2e/analytics/test_analytics.py
  • tests/e2e/analytics/test_highlights.py
  • tests/e2e/assertions/dbt_test_results_test.py
  • tests/e2e/authorization/test_self_entity_auth.py
  • tests/e2e/cli/ingest_cmd/test_timeseries_rollback.py
  • tests/e2e/cli/migrate_cmd/test_migrate_instance2instance_smoke.py
  • tests/e2e/cli/migrate_cmd/test_migrate_scenarios_smoke.py
  • tests/e2e/cli/user_cmd/test_user_add.py
  • tests/e2e/cli/user_groups_cmd/test_user_cmd.py
  • tests/e2e/delete/delete_test.py
  • tests/e2e/domains/domain_entities_batching_test.py
  • tests/e2e/entity_versioning/test_glossary_term_new_version.py
  • tests/e2e/entity_versioning/test_glossary_versioning.py
  • tests/e2e/entity_versioning/test_versioning_ingest.py
  • tests/e2e/frontend/test_static_asset_encodings.py
  • tests/e2e/glossary/glossary_children_count_test.py
  • tests/e2e/glossary/parent_nodes_batching_test.py
  • tests/e2e/institutional_memory/institutional_memory_test.py
  • tests/e2e/knowledge/document_change_history_test.py
  • tests/e2e/knowledge/document_search_filter_test.py
  • tests/e2e/knowledge/test_document_crud.py::TestDocumentCrudAndMutations
  • tests/e2e/knowledge/test_document_hierarchy_settings.py::TestDocumentHierarchyAndSettings
  • tests/e2e/knowledge/test_document_search_history.py::TestDocumentSearchAndHistory
  • tests/e2e/knowledge/test_okf_reimport.py
  • tests/e2e/lineage/test_lineage_sdk.py
  • tests/e2e/managed_ingestion/managed_ingestion_test.py
  • tests/e2e/mcp/mcp_test.py
  • tests/e2e/metrics/test_metrics.py
  • tests/e2e/metrics/test_queue_ingest_usage.py
  • tests/e2e/odcs/test_odcs_ingestion.py
  • tests/e2e/openapi/v1/test_tracking.py
  • tests/e2e/openapi/v3/test_scroll_entities.py
  • tests/e2e/patch/test_domain_patches.py
  • tests/e2e/platform_resources/test_platform_resource.py
  • tests/e2e/read_only/test_analytics.py
  • tests/e2e/read_only/test_ingestion_list.py
  • tests/e2e/read_only/test_services_up.py
  • tests/e2e/restli/test_restli_batch_ingestion.py
  • tests/e2e/schema_fields/test_schemafields.py
  • tests/e2e/search/test_search_projection.py::TestSearchProjection
  • tests/e2e/semantic/test_stateful_ingestion.py::TestStatefulIngestion
  • tests/e2e/service_accounts/test_service_accounts.py
  • tests/e2e/status/test_glossary_lifecycle_stages.py::TestGlossaryTermLifecycleStages
  • tests/e2e/status/test_lifecycle_state.py::TestLifecycleStageAPIs
  • tests/e2e/tags_and_terms/tags_and_terms_test.py
  • tests/e2e/telemetry/telemetry_test.py
  • tests/e2e/test_authentication_e2e.py
  • tests/e2e/test_e2e.py
  • tests/e2e/test_kafka_default_sink.py
  • tests/e2e/test_stateful_ingestion.py
  • tests/e2e/tokens/revokable_access_token_test.py
  • tests/e2e/tokens/session_access_token_test.py
  • tests/e2e/trace/test_api_trace.py

Add the run-all-tests:pytest label to run the full pytest suite on this PR.

commit 17b34f9 · workflow run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@github-actions

Copy link
Copy Markdown
Contributor

i18n locale parity

Status: ⚠️ drift detected (warn-only) — 38 issue(s) across 13 locale(s)

Locale Missing keys Stale keys Placeholder Files
de 69 10 0 11
es 0 10 0 1
fi 0 12 0 2
fr 0 10 0 1
hu 0 10 0 1
it 0 10 0 1
ja 0 12 0 2
nb 0 10 0 1
pt-BR 0 10 0 1
ru 0 13 0 3
sv 0 10 0 1
zh-CN 69 10 0 11
zh-TW 0 12 0 2

Per-key detail is in the job summary of the datahub-web-react-lint run, or reproduce locally:

./gradlew :datahub-web-react:yarnI18nParityCheck        # all locales
cd datahub-web-react && yarn check-i18n-parity --lang de  # one locale

… index for the local stack

- requires(PLAY_FRONTEND) on mcp/mcp_test.py and the two Bearer-token
  tests in test_authentication_e2e.py.
- requires(KAFKA) on the actions doc/term propagation modules: the local
  stack runs no actions process.
- Drop the investigation marker from test_actuator_prometheus_no_auth.
- test_queue_ingest_usage.py needs only KAFKA.
- Analytics backfill writes to ELASTICSEARCH_INDEX, so it honours the
  local stack's index prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 17b34f9. Configure here.

logger.info(f"✅ GraphQL with valid session: {response.status_code}")


@pytest.mark.requires(Capability.PLAY_FRONTEND)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unmarked prometheus test fails locally

High Severity

Removing DOCKER_FREE_INVESTIGATION from test_actuator_prometheus_no_auth puts this p0 test on the local lane, but get_gms_prometheus_base_url still rewrites a GMS URL on port 8080 to :4319. Local GMS keeps Actuator on the main port (no MANAGEMENT_SERVER_PORT), so slot-0 local stacks hit connection refused instead of a status code.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 17b34f9. Configure here.

@devashish2203
devashish2203 merged commit aad2373 into master Nov 26, 2026
60 checks passed
@devashish2203
devashish2203 deleted the test/p-pfp-1235-smoke-backend-selection branch November 26, 2026 15:11

This branch was successfully deployed

1 active deployment
Preview — 17b34f98 Deployed Nov 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops PR or Issue related to DataHub backend & deployment smoke_test Contains changes related to smoke tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants