@@ -1429,8 +1429,18 @@ def test_subdag_clear(self):
1429
1429
'clear' , 'example_subdag_operator' , '--no_confirm' , '--exclude_subdags' ])
1430
1430
cli .clear (args )
1431
1431
1432
+ def test_parentdag_downstream_clear (self ):
1433
+ args = self .parser .parse_args ([
1434
+ 'clear' , 'example_subdag_operator.section-1' , '--no_confirm' ])
1435
+ cli .clear (args )
1436
+ args = self .parser .parse_args ([
1437
+ 'clear' , 'example_subdag_operator.section-1' , '--no_confirm' ,
1438
+ '--exclude_parentdag' ])
1439
+ cli .clear (args )
1440
+
1432
1441
def test_get_dags (self ):
1433
- dags = cli .get_dags (self .parser .parse_args (['clear' , 'example_subdag_operator' , '-c' ]))
1442
+ dags = cli .get_dags (self .parser .parse_args (['clear' , 'example_subdag_operator' ,
1443
+ '-c' ]))
1434
1444
self .assertEqual (len (dags ), 1 )
1435
1445
1436
1446
dags = cli .get_dags (self .parser .parse_args (['clear' , 'subdag' , '-dx' , '-c' ]))
@@ -1942,6 +1952,34 @@ def test_dag_views(self):
1942
1952
response = self .app .get (url )
1943
1953
self .assertIn ("Wait a minute" , response .data .decode ('utf-8' ))
1944
1954
response = self .app .get (url + "&confirmed=true" )
1955
+ url = (
1956
+ "/admin/airflow/clear?task_id=section-1-task-1&"
1957
+ "dag_id=example_subdag_operator.section-1&future=false&past=false&"
1958
+ "upstream=false&downstream=true&recursive=true&"
1959
+ "execution_date={}&"
1960
+ "origin=/admin" .format (DEFAULT_DATE_DS ))
1961
+ response = self .app .get (url )
1962
+ self .assertIn ("Wait a minute" , response .data .decode ('utf-8' ))
1963
+ self .assertIn ("example_subdag_operator.end" ,
1964
+ response .data .decode ('utf-8' ))
1965
+ self .assertIn ("example_subdag_operator.section-1.section-1-task-1" ,
1966
+ response .data .decode ('utf-8' ))
1967
+ self .assertIn ("example_subdag_operator.section-1" ,
1968
+ response .data .decode ('utf-8' ))
1969
+ self .assertIn ("example_subdag_operator.section-2" ,
1970
+ response .data .decode ('utf-8' ))
1971
+ self .assertIn ("example_subdag_operator.section-2.section-2-task-1" ,
1972
+ response .data .decode ('utf-8' ))
1973
+ self .assertIn ("example_subdag_operator.section-2.section-2-task-2" ,
1974
+ response .data .decode ('utf-8' ))
1975
+ self .assertIn ("example_subdag_operator.section-2.section-2-task-3" ,
1976
+ response .data .decode ('utf-8' ))
1977
+ self .assertIn ("example_subdag_operator.section-2.section-2-task-4" ,
1978
+ response .data .decode ('utf-8' ))
1979
+ self .assertIn ("example_subdag_operator.section-2.section-2-task-5" ,
1980
+ response .data .decode ('utf-8' ))
1981
+ self .assertIn ("example_subdag_operator.some-other-task" ,
1982
+ response .data .decode ('utf-8' ))
1945
1983
url = (
1946
1984
"/admin/airflow/run?task_id=runme_0&"
1947
1985
"dag_id=example_bash_operator&ignore_all_deps=false&ignore_ti_state=true&"
0 commit comments