dstandish commented on code in PR #31658:
URL: https://github.com/apache/airflow/pull/31658#discussion_r1213669374
##########
tests/models/test_dagrun.py:
##########
@@ -2469,3 +2470,71 @@ def mytask():
session.flush()
dr = session.query(DagRun).one()
assert dr.state == DagRunState.FAILED
+
+
[email protected](
+ "input, expected",
+ [
+ (["s1 >> w1 >> t1"], {"w1"}), # t1 ignored
+ (["s1 >> w1 >> t1", "s1 >> t1"], {"w1"}), # t1 ignored; properly
wired to setup
+ (["s1 >> w1"], {"w1"}), # no teardown
+ (["s1 >> w1 >> t1_"], {"t1_"}), # t1_ is natural leaf and OFFD=True;
+ (["s1 >> w1 >> t1_", "s1 >> t1_"], {"t1_"}), # t1_ is natural leaf
and OFFD=True; wired to setup
+ (["s1 >> w1 >> t1_ >> w2", "s1 >> t1_"], {"w2"}), # t1_ is not a
natural leaf so excluded anyway
+ ],
+)
+def test_tis_considered_for_state(dag_maker, session, input, expected):
+ """
+ We use a convenience notation to wire up test scenarios:
+
+ t<num> -- teardown task
+ t<num>_ -- teardown task with on_failure_fail_dagrun = True
+ s<num>_ -- setup task
Review Comment:
```suggestion
s<num> -- setup task
```
--
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]