Repository navigation
Fix test_get_task_states_with_task_group_id_and_task_id to actually cover its name - #72294
Merged
potiuk merged 1 commit intoSep 9, 2026
Merged
Conversation
…over its name The test only ever passed task_group_id in the request, never task_ids, so it exercised the same code path as test_get_task_states_group_id_basic and left the task_group_id + task_ids union branch in get_task_instance_states untested despite the test's name.
Contributor
|
Awesome!! |
fat-catTW
approved these changes
Sep 5, 2026
potiuk
approved these changes
Sep 9, 2026
imrichardwu
pushed a commit
to imrichardwu/airflow
that referenced
this pull request
Sep 11, 2026
…over its name (apache#72294) The test only ever passed task_group_id in the request, never task_ids, so it exercised the same code path as test_get_task_states_group_id_basic and left the task_group_id + task_ids union branch in get_task_instance_states untested despite the test's name.
regarmukesh3g
pushed a commit
to regarmukesh3g/airflow
that referenced
this pull request
Sep 27, 2026
…over its name (apache#72294) The test only ever passed task_group_id in the request, never task_ids, so it exercised the same code path as test_get_task_states_group_id_basic and left the task_group_id + task_ids union branch in get_task_instance_states untested despite the test's name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sumarry
test_get_task_states_with_task_group_id_and_task_idinairflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_instances.py(TestGetTaskStates) is named to cover the case whereGET /execution/task-instances/statesis called with bothtask_group_idandtask_idsset — the union-of-both-filters branch inget_task_instance_states(airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py):The request built by the test only ever set
task_group_idinparams;task_idswas never passed. That makes the test identical in coverage totest_get_task_states_group_id_basic(which also only exercisestask_group_idalone) -- thetask_group_id | task_idsunion branch was untested despite the test's name claiming otherwise.Change
test_get_task_states_with_task_group_id_and_task_id: added"task_ids": ["task2"]to the request params, alongsidetask_group_id="group1".task2is a Dag-level task outsidegroup1in this test's Dag, and the fixture already assigns it a distinct state (FAILED), so the expected response now asserts bothgroup1.task1(from the task group) andtask2(from the explicittask_idsfilter) appear together intask_states-- actually exercising the union path the test name describes.