@@ -1316,8 +1316,18 @@ def test_subdag_clear(self):
1316
1316
'clear' , 'example_subdag_operator' , '--no_confirm' , '--exclude_subdags' ])
1317
1317
cli .clear (args )
1318
1318
1319
+ def test_parentdag_downstream_clear (self ):
1320
+ args = self .parser .parse_args ([
1321
+ 'clear' , 'example_subdag_operator.section-1' , '--no_confirm' ])
1322
+ cli .clear (args )
1323
+ args = self .parser .parse_args ([
1324
+ 'clear' , 'example_subdag_operator.section-1' , '--no_confirm' ,
1325
+ '--exclude_parentdag' ])
1326
+ cli .clear (args )
1327
+
1319
1328
def test_get_dags (self ):
1320
- dags = cli .get_dags (self .parser .parse_args (['clear' , 'example_subdag_operator' , '-c' ]))
1329
+ dags = cli .get_dags (self .parser .parse_args (['clear' , 'example_subdag_operator' ,
1330
+ '-c' ]))
1321
1331
self .assertEqual (len (dags ), 1 )
1322
1332
1323
1333
dags = cli .get_dags (self .parser .parse_args (['clear' , 'subdag' , '-dx' , '-c' ]))
@@ -1793,6 +1803,34 @@ def test_dag_views(self):
1793
1803
response = self .app .get (url )
1794
1804
self .assertIn ("Wait a minute" , response .data .decode ('utf-8' ))
1795
1805
response = self .app .get (url + "&confirmed=true" )
1806
+ url = (
1807
+ "/admin/airflow/clear?task_id=section-1-task-1&"
1808
+ "dag_id=example_subdag_operator.section-1&future=false&past=false&"
1809
+ "upstream=false&downstream=true&recursive=true&"
1810
+ "execution_date={}&"
1811
+ "origin=/admin" .format (DEFAULT_DATE_DS ))
1812
+ response = self .app .get (url )
1813
+ self .assertIn ("Wait a minute" , response .data .decode ('utf-8' ))
1814
+ self .assertIn ("example_subdag_operator.end" ,
1815
+ response .data .decode ('utf-8' ))
1816
+ self .assertIn ("example_subdag_operator.section-1.section-1-task-1" ,
1817
+ response .data .decode ('utf-8' ))
1818
+ self .assertIn ("example_subdag_operator.section-1" ,
1819
+ response .data .decode ('utf-8' ))
1820
+ self .assertIn ("example_subdag_operator.section-2" ,
1821
+ response .data .decode ('utf-8' ))
1822
+ self .assertIn ("example_subdag_operator.section-2.section-2-task-1" ,
1823
+ response .data .decode ('utf-8' ))
1824
+ self .assertIn ("example_subdag_operator.section-2.section-2-task-2" ,
1825
+ response .data .decode ('utf-8' ))
1826
+ self .assertIn ("example_subdag_operator.section-2.section-2-task-3" ,
1827
+ response .data .decode ('utf-8' ))
1828
+ self .assertIn ("example_subdag_operator.section-2.section-2-task-4" ,
1829
+ response .data .decode ('utf-8' ))
1830
+ self .assertIn ("example_subdag_operator.section-2.section-2-task-5" ,
1831
+ response .data .decode ('utf-8' ))
1832
+ self .assertIn ("example_subdag_operator.some-other-task" ,
1833
+ response .data .decode ('utf-8' ))
1796
1834
url = (
1797
1835
"/admin/airflow/run?task_id=runme_0&"
1798
1836
"dag_id=example_bash_operator&ignore_all_deps=false&ignore_ti_state=true&"
0 commit comments