meel-ayush opened a new pull request, #77119:
URL: https://github.com/apache/airflow/pull/77119
### Description
A few selective checks and test runners were running unnecessarily on PRs:
- `run_system_tests` mirrored `run_unit_tests`, running system tests even
when only standard unit tests were touched.
- `run_generic_basic_tests` ran on every PR, including doc-only or text-only
changes.
- `test-git-clone-on-windows` ran on every PR, even when no new files or
paths were added or renamed.
- `import_graph.py` checked relative imports with `DOTTED_NAME.match("x" +
value)`, which failed on multi-dot relative imports like `..hooks.base`.
- In pytest, `quarantined`, `system`, and `long_running` tests were
distributed to `pytest-xdist` workers before being skipped at runtime,
increasing worker memory usage.
This change:
* Fixes the AST import graph regex so multi-dot relative imports resolve
correctly.
* Adds provider system test paths to `SYSTEM_TEST_FILES` and gates
`run_system_tests` so it only runs when system test files change or full tests
are requested.
* Skips `run_generic_basic_tests` on text-only, doc-only, or
component-branch PRs.
* Adds `has_added_or_renamed_files` via `git diff-tree --diff-filter=AR` to
skip the Windows clone check when no new files or paths are added.
* Deselects unselected `quarantined`, `system`, and `long_running` tests
early in `pytest_collection_modifyitems` so workers never receive them.
* Updates `dev/breeze/doc/ci/04_selective_checks.md` to match the new
outputs.
### Tests
- Unit tests added in `dev/breeze/tests/test_import_graph.py` for multi-dot
relative import matching.
- Parameterized tests added in `dev/breeze/tests/test_selective_checks.py`
for system test gating, generic basic test gating, and added/renamed file
detection.
- Unit tests added in
`devel-common/tests/unit/tests_common/test_pytest_plugin.py` verifying
collection deselection.
---
##### Was generative AI tooling used to co-author this PR?
- [ ] Yes (please specify the tool below)
--
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]