hussein-awala commented on code in PR #33570:
URL: https://github.com/apache/airflow/pull/33570#discussion_r1306480924
##########
tests/models/test_taskinstance.py:
##########
@@ -1270,20 +1338,142 @@ def test_depends_on_past(self, dag_maker):
param(
"all_done_setup_success",
1,
- _UpstreamTIStates(3, 1, 0, 0, 0, 4, 1, 0),
+ 0,
+ _UpstreamTIStates(3, 1, 0, 0, 0, 4, 1, 0, 0),
True,
None,
False,
id="not all done, one skipped",
),
+ param(
+ "all_success",
+ 0,
+ 2,
+ _UpstreamTIStates(7, 0, 0, 0, 0, 7, 2, 0, 0),
+ True,
+ None,
+ True,
+ id="indirect upstream setups - all success",
+ ),
+ param(
+ "all_success",
+ 0,
+ 2,
+ _UpstreamTIStates(7, 0, 0, 0, 0, 7, 1, 0, 0),
+ True,
+ None,
+ False,
+ id="indirect upstream setups - one not done and one success",
+ ),
+ param(
+ "all_success",
+ 0,
+ 2,
+ _UpstreamTIStates(7, 0, 0, 0, 0, 7, 0, 1, 0),
+ True,
+ None,
+ False,
+ id="indirect upstream setups - one not done and one skipped",
+ ),
+ param(
+ "all_success",
+ 0,
+ 2,
+ _UpstreamTIStates(7, 0, 0, 0, 0, 7, 1, 1, 0),
+ True,
+ TaskInstanceState.SKIPPED,
+ True,
+ id="indirect upstream setups - all done: one skipped and one
success",
+ ),
+ param(
+ "all_success",
+ 0,
+ 2,
+ _UpstreamTIStates(7, 0, 0, 0, 0, 7, 1, 0, 1),
+ True,
+ TaskInstanceState.UPSTREAM_FAILED,
+ False,
+ id="indirect upstream setups - all done: one success and one
failed",
+ ),
+ param(
+ "all_success",
+ 0,
+ 2,
+ _UpstreamTIStates(7, 0, 0, 0, 0, 7, 0, 1, 1),
+ True,
+ TaskInstanceState.UPSTREAM_FAILED,
+ False,
+ id="indirect upstream setups - all done: one skipped and one
failed",
+ ),
+ param(
+ "all_success",
+ 0,
+ 2,
+ _UpstreamTIStates(7, 0, 0, 0, 0, 7, 0, 0, 1),
+ True,
+ TaskInstanceState.UPSTREAM_FAILED,
+ False,
+ id="indirect upstream setups - one not done and one failed",
+ ),
+ param(
+ "all_success",
+ 0,
+ 2,
+ _UpstreamTIStates(0, 0, 1, 0, 0, 1, 2, 0, 0),
+ True,
+ TaskInstanceState.UPSTREAM_FAILED,
+ False,
+ id="indirect upstream setups - all setup success but upstream
failed",
+ ),
+ param(
+ "all_success",
+ 0,
+ 2,
+ _UpstreamTIStates(5, 0, 0, 0, 0, 5, 2, 0, 0),
+ True,
+ None,
+ False,
+ id="indirect upstream setups - all setup success but upstream
still running",
+ ),
+ param(
+ "all_success",
+ 0,
+ 2,
+ _UpstreamTIStates(5, 0, 0, 0, 0, 5, 0, 0, 1),
+ True,
+ TaskInstanceState.UPSTREAM_FAILED,
+ False,
+ id="indirect upstream setups - one setup failed but upstream
still running",
+ ),
+ param(
+ "all_success",
+ 0,
+ 2,
+ _UpstreamTIStates(4, 0, 1, 0, 0, 5, 0, 2, 0),
+ True,
+ TaskInstanceState.UPSTREAM_FAILED,
+ False,
+ id="indirect upstream setups - all setup skipped but upstream
failed",
+ ),
+ param(
+ "all_success",
+ 0,
+ 2,
+ _UpstreamTIStates(0, 7, 0, 0, 0, 7, 0, 0, 1),
+ True,
+ TaskInstanceState.UPSTREAM_FAILED,
+ False,
+ id="indirect upstream setups - one setup failed but upstream
skipped",
+ ),
],
)
def test_check_task_dependencies(
Review Comment:
It was my first thought, but I tried to avoid duplicating the code. But yeah
+1
--
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]