Skip to content

Fix Breeze --mount-sources tests not mounting local core tests - #74553

Open
sjyangkevin wants to merge 1 commit into
apache:mainfrom
sjyangkevin:fix-tests-sources-airflow-core-mount
Open

sjyangkevin wants to merge 1 commit into
apache:mainfrom
sjyangkevin:fix-tests-sources-airflow-core-mount

Conversation

@sjyangkevin

Copy link
Copy Markdown
Contributor

What's the issue

From my understanding, breeze ... --mount-sources tests is meant to run local tests against an Airflow installed from a package. For core tests it seems doesn't, because the mount line in scripts/ci/docker-compose/tests-sources.yml has the folder name swapped:

- ../../../core-airflow/tests/:/opt/airflow/core-airflow/tests:cached

As a result:

  • Local edits to core tests never reach the container. /opt/airflow/airflow-core/tests keeps the copy baked into the CI image when it was built, and pytest runs that copy.
  • Docker creates an empty core-airflow/tests folder in the repo root, because the misspelled host path doesn't exist.

When it was introduced

In #47798 (https://github.com/apache/airflow/pull/47798/changes#diff-c26b9fa407d8179ef67b1cbba03a643a4d8edee5760aae321c273f9b7327966c), which moved the core sources and tests into airflow-core/. The old top-level ../../../tests/:/opt/airflow/tests mount was rewritten and the two words got swapped. This line is the only place the name is spelled that way. It sits outside the block the generate-volumes-for-sources hook regenerates, so nothing caught it.

When it happens

It shows up when you run Breeze with --mount-sources tests (which requires --use-airflow-version), for example to reproduce a provider compatibility run locally as described in contributing-docs/testing/unit_tests.rst, and either:

  • you edit or add tests under airflow-core/tests, or
  • you edit shared files under airflow-core/tests that every test run loads (unit/dags, unit/plugins, deprecations_ignore.yml), which affects provider tests too.

What you might see then:

  • a new test is reported as "not found";
  • a fixed test still fails the old way;
  • a test you tightened passes, because the old version ran.

Not affected: CI (compatibility jobs use --mount-sources remove), the default selected mode, and provider test folders in this mode, which are mounted correctly.

The fix

Correct the path so local airflow-core/tests is mounted at /opt/airflow/airflow-core/tests, the same as providers-and-tests-sources.yml already does:

- ../../../airflow-core/tests/:/opt/airflow/airflow-core/tests:cached

The pre-commit and manual prek hooks pass on the file, including yamllint and the Docker compose lint. breeze verify lists no local tests for this change.

Screenshots

breeze shell --use-airflow-version 3.3.2 --mount-sources tests --backend sqlite --python 3.11 \
  "cat /opt/airflow/airflow-core/tests/unit/zz_mount_check.txt; ls -d /opt/airflow/core-airflow"

Before (main): the marker isn't visible in the container, and /opt/airflow/core-airflow is created, along with core-airflow/tests on the host.

Screenshot from 2026-10-10 20-38-11 Screenshot from 2026-10-10 20-38-49

After (this PR): the marker is visible, and no stray folder is created.

Screenshot from 2026-10-10 20-39-24 Screenshot from 2026-10-10 20-41-00
Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5.5)

Generated-by: Claude Code (Opus 5.5) following the guidelines

The tests mount mode lets developers iterate on their local tests while
Airflow itself is installed from a package. The core tests entry pointed
at a misspelled host folder, so the container kept the copy of
airflow-core/tests baked into the CI image and silently ran it instead
of the local edits. Docker also created an empty core-airflow/ folder in
the repo root on every run.
@sjyangkevin

Copy link
Copy Markdown
Contributor Author

The CI failed due to following 503 will retry later.

Could not pull cr.yandex/yc/yandex-docker-local-ydb:latest in 5 attempts.
Running command:
time="2026-10-11T02:53:41Z" level=warning msg="/home/runner/work/airflow/airflow/scripts/ci/docker-compose/integration-ydb.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion"
ydb Pulling
ydb Error received unexpected HTTP status: 503 Service Unavailable
Error response from daemon: received unexpected HTTP status: 503 Service Unavailable

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant