ZJ-lucky-0915 opened a new pull request, #75609: URL: https://github.com/apache/airflow/pull/75609
`airflowctl/ctl/utils/dag_run.py` had no dedicated test module. It resolves the Dag run a command acts on from either `run_id` or `--logical-date`, and contains several exit paths that were previously unverified. Added unit tests for: - selector validation (exactly one of `run_id` / `--logical-date`) - fetching by `run_id`, including `suppress_error_log=True` - 404 vs non-404 handling for both lookup paths - timezone requirement and parsing for `--logical-date` - the exact-matching query parameters (`gte == lte`, `order_by="-id"`, `limit=1`) - `resolve_dag_run_id` taking `run_id` at face value without hitting the API Coverage of `dag_run.py`: 79% → 100% (17 tests). No production code changed. --- ##### Was generative AI tooling used to co-author this PR? - [x] Yes (please specify the tool below) Generated-by: OpenAI Codex following the [Airflow Gen-AI guidelines] (https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) I reviewed the generated tests, ran them locally (17 passed, 100% branch coverage of `dag_run.py`), and confirmed they pass `ruff check` and `ruff format --check`. -- 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]
