Copilot commented on code in PR #63981: URL: https://github.com/apache/airflow/pull/63981#discussion_r3025338564
########## AGENTS.md: ########## @@ -15,10 +15,19 @@ `<PROJECT>` is folder where pyproject.toml of the package you want to test is located. For example, `airflow-core` or `providers/amazon`. `<target_branch>` is the branch the PR will be merged into — usually `main`, but could be `v3-1-test` when creating a PR for the 3.1 branch. -- **Run a single test:** `uv run --project <PROJECT> pytest path/to/test.py::TestClass::test_method -xvs` -- **Run a test file:** `uv run --project <PROJECT> pytest path/to/test.py -xvs` -- **Run all tests in package:** `uv run --project <PROJECT> pytest path/to/package -xvs` -- **If uv tests fail with missing system dependencies, run the tests with breeze**: `breeze run pytest <tests> -xvs` + +> [!IMPORTANT] +> **Host vs. Container:** Some commands (like `uv run`) work only on the **host** (outside Breeze), +> while others (like `breeze run pytest`) run via Docker and can be invoked from the host. +> If a test requires system-level dependencies (databases, service containers, etc.) +> or you are unsure, always use `breeze run pytest <tests>` instead of `uv run pytest`. +> To detect your context: the file `/.dockerenv` exists inside the Breeze container; +> CI environments typically set standard env vars such as `CI` or `GITHUB_ACTIONS`; +> and `BREEZE="true"` is set inside a running Breeze container. + +- **Run a single test (host, no system deps):** `uv run --project <PROJECT> pytest path/to/test.py::TestClass::test_method -xvs` +- **Run a single test (inside Breeze or with system deps):** `breeze run pytest path/to/test.py::TestClass::test_method -xvs` Review Comment: Only “Run a single test” examples remain after the rewrite; the previously documented “run a test file” / “run all tests in package” variants were removed. If the goal is to clarify host vs Breeze without losing guidance, consider re-adding those variants for both execution modes (or add a short note on how to adapt the path argument) so agents/humans can still easily choose the right granularity. ```suggestion - **Run a single test (inside Breeze or with system deps):** `breeze run pytest path/to/test.py::TestClass::test_method -xvs` - **Run all tests in a file (host, no system deps):** `uv run --project <PROJECT> pytest path/to/test_file.py -xvs` - **Run all tests in a file (inside Breeze or with system deps):** `breeze run pytest path/to/test_file.py -xvs` - **Run all tests in a package/directory (host, no system deps):** `uv run --project <PROJECT> pytest path/to/tests/package/ -xvs` - **Run all tests in a package/directory (inside Breeze or with system deps):** `breeze run pytest path/to/tests/package/ -xvs` ``` ########## AGENTS.md: ########## @@ -31,7 +40,7 @@ - **Run scripts tests:** `uv run --project scripts pytest scripts/tests/ -xvs` - **Run Airflow CLI:** `breeze run airflow dags list` - **Type-check:** `breeze run mypy path/to/code` -- **Lint with ruff only:** `prek run ruff --from-ref <target_branch>` +- **Lint with ruff only:** `pre-commit run ruff --from-ref <target_branch>` Review Comment: `pre-commit run ruff --from-ref <target_branch>` is likely not a valid command (upstream `pre-commit` doesn’t support `--from-ref`; that’s a `prek` feature used elsewhere in this doc). Since this file already instructs using `prek` (and `.pre-commit-config.yaml` declares `minimum_prek_version`), consider keeping `prek run ruff --from-ref <target_branch>` here for consistency and correctness. ```suggestion - **Lint with ruff only:** `prek run ruff --from-ref <target_branch>` ``` -- 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]
