sjyangkevin opened a new pull request, #74553:
URL: https://github.com/apache/airflow/pull/74553

   ### 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:
   
   ```yaml
   - ../../../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:
   
   ```yaml
   - ../../../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
   
   ```bash
   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.
   
   <img width="1455" height="261" alt="Screenshot from 2026-10-10 20-38-11" 
src="https://github.com/user-attachments/assets/ffe9039e-23d8-431b-b197-ba15af93acdc";
 />
   
   <img width="1454" height="497" alt="Screenshot from 2026-10-10 20-38-49" 
src="https://github.com/user-attachments/assets/157f93e4-3869-4d50-bb8a-3d28cef3df3a";
 />
   
   **After (this PR):** the marker is visible, and no stray folder is created.
   
   <img width="1458" height="435" alt="Screenshot from 2026-10-10 20-39-24" 
src="https://github.com/user-attachments/assets/2b2c58cf-02e4-4413-a60c-1e7f82b53740";
 />
   
   <img width="1465" height="492" alt="Screenshot from 2026-10-10 20-41-00" 
src="https://github.com/user-attachments/assets/b37fe260-6f54-4e44-9095-a3775bd2f4a3";
 />
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.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]

Reply via email to