coleheflin opened a new pull request, #71637:
URL: https://github.com/apache/airflow/pull/71637
## What
- Adds `apache-airflow-shared-module-loading` and
`apache-airflow-shared-secrets-masker` as explicit dependencies of
`devel-common` (with matching `tool.uv.sources` workspace entries), since
`tests_common` imports `airflow_shared.secrets_masker` and
`airflow_shared.module_loading` directly but never declared them.
- Adds a `skip_unless_all_providers_installed` marker to
`tests_common.test_utils.markers` and applies it (or a targeted
`pytest.importorskip`) to 11 tests in `test_providers_manager.py` and
`test_configuration.py` that assumed the full ~100+ provider set is always
installed.
## Why
closes: #60770
Running `uv sync --project airflow-core` succeeds (as the issue notes), but
the resulting test suite is not actually runnable standalone: `devel-common`'s
dependency on the shared distributions was implicit — it worked only because a
full workspace `uv sync` happens to install them as a side effect of other
projects needing them. In a scoped sync, `pytest` collection crashed outright
with `ModuleNotFoundError: No module named 'airflow_shared'`.
Once collection was fixed, 11 further tests failed at runtime because they
hard-code assumptions valid only when the full provider set is installed — e.g.
counting connection form widgets, CLI command registrations, or a fixed
`sensitive_config_values` set that includes provider-contributed entries
(`keycloak_auth_manager`, `hashicorp` vault backend, etc.).
`airflow-core/pyproject.toml` already carries a maintainer TODO acknowledging
its `dev` group only installs 6 providers (amazon, celery, cncf-kubernetes,
fab, git, ftp) rather than the full set "eventually" — these tests hadn't
caught up to that gap.
This does **not** attempt the larger, already-tracked migration of removing
those 6 providers from airflow-core's dev group (see the TODO) — that's
separate, larger follow-up work. This PR only makes the currently-declared
scope (`uv sync --project airflow-core` + its test suite) actually pass clean.
## Testing performed
- Reproduced the bug directly: ran `uv sync --project airflow-core` (a
core-only sync, confirmed via `uv sync` uninstalling ~150 unrelated provider
packages from the shared workspace venv) followed by `uv run --project
airflow-core pytest airflow-core/tests/unit --collect-only`, which failed with
11 collection errors, and a full non-db run, which had 11 additional test
failures.
- Applied the fix, regenerated `uv.lock`, re-synced `airflow-core` in
isolation, and confirmed:
- `pytest --collect-only` now collects cleanly (12559 tests, 0 errors).
- The non-db unit suite (`pytest airflow-core/tests/unit -m "not
db_test"`) now passes fully: `3673 passed, 40 skipped, 2 xfailed`, with the 11
previously-failing tests now skipping with clear reasons instead of failing.
- Restored the shared venv to a full `uv sync` and re-ran the same two test
files to confirm all 227 tests still pass for real (the new marker correctly
no-ops when the full provider set is present), so this doesn't weaken coverage
in the normal dev/CI environment.
- Ran `prek run --from-ref upstream/main --stage pre-commit` (ruff, mypy for
airflow-core, and the rest of the fast hook suite) — all passed.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Sonnet 5)
Generated-by: Claude Code (Sonnet 5) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]