Files
airflow/.github/workflows
Jarek Potiuk 4395fe9477 Add tests for scripts and remove redundant sys.path.insert calls (#63598)
* Add tests for scripts and remove redundant sys.path.insert calls

- Remove 85 redundant `sys.path.insert(0, str(Path(__file__).parent.resolve()))`
  calls from scripts in ci/prek/, cov/, and in_container/. Python already
  adds the script's directory to sys.path when running a file directly,
  making these calls unnecessary.
- Keep 6 cross-directory sys.path.insert calls that are genuinely needed
  (AIRFLOW_CORE_SOURCES_PATH, AIRFLOW_ROOT, etc.).
- Add __init__.py files to scripts/ci/ and scripts/ci/prek/ to make them
  proper Python packages.
- Add scripts/pyproject.toml with package discovery and pytest config.
- Add 176 tests covering: common_prek_utils (insert_documentation,
  check_list_sorted, get_provider_id_from_path, ConsoleDiff, etc.),
  new_session_in_provide_session, check_deprecations, unittest_testcase,
  changelog_duplicates, newsfragments, checkout_no_credentials, and
  check_order_dockerfile_extras.
- Add scripts tests to CI: new SCRIPTS_FILES file group in selective
  checks, run-scripts-tests output, and tests-scripts job in
  basic-tests.yml.
- Document scripts as a workspace distribution in CLAUDE.md.

* Add pytest as dev dependency for scripts distribution

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Use devel-common instead of pytest for scripts dev dependencies

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix xdist test collection order for newsfragment tests

Sort the VALID_CHANGE_TYPES set when passing to parametrize to ensure
deterministic test ordering across xdist workers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Update scripts/ci/prek/changelog_duplicates.py

Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>

* Refactor scripts tests: convert setup methods to fixtures and extract constants

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Dev-iL <6509619+Dev-iL@users.noreply.github.com>
2026-03-14 17:22:46 +01:00
..