Commit a77fe0c 1 parent 562f6df commit a77fe0c Copy full SHA for a77fe0c
File tree 3 files changed +24
-3
lines changed
3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -2078,14 +2078,14 @@ def test_dag_view_task_with_python_operator_using_partial(self):
2078
2078
response = self .app .get (
2079
2079
'/admin/airflow/task?'
2080
2080
'task_id=test_dagrun_functool_partial&dag_id=test_task_view_type_check&'
2081
- 'execution_date={}' .format (DEFAULT_DATE_DS ))
2081
+ 'execution_date={}' .format (EXAMPLE_DAG_DEFAULT_DATE ))
2082
2082
self .assertIn ("A function with two args" , response .data .decode ('utf-8' ))
2083
2083
2084
2084
def test_dag_view_task_with_python_operator_using_instance (self ):
2085
2085
response = self .app .get (
2086
2086
'/admin/airflow/task?'
2087
2087
'task_id=test_dagrun_instance&dag_id=test_task_view_type_check&'
2088
- 'execution_date={}' .format (DEFAULT_DATE_DS ))
2088
+ 'execution_date={}' .format (EXAMPLE_DAG_DEFAULT_DATE ))
2089
2089
self .assertIn ("A __call__ method" , response .data .decode ('utf-8' ))
2090
2090
2091
2091
def tearDown (self ):
Original file line number Diff line number Diff line change @@ -2273,6 +2273,27 @@ def test_scheduler_task_start_date(self):
2273
2273
for t in ti2s :
2274
2274
self .assertEqual (t .state , State .SUCCESS )
2275
2275
2276
+ def test_scheduler_task_start_date (self ):
2277
+ """
2278
+ Test that the scheduler respects task start dates that are different
2279
+ from DAG start dates
2280
+ """
2281
+ dag_id = 'test_task_start_date_scheduling'
2282
+ dag = self .dagbag .get_dag (dag_id )
2283
+ dag .clear ()
2284
+ scheduler = SchedulerJob (dag_id ,
2285
+ num_runs = 2 )
2286
+ scheduler .run ()
2287
+
2288
+ session = settings .Session ()
2289
+ tiq = session .query (TI ).filter (TI .dag_id == dag_id )
2290
+ ti1s = tiq .filter (TI .task_id == 'dummy1' ).all ()
2291
+ ti2s = tiq .filter (TI .task_id == 'dummy2' ).all ()
2292
+ self .assertEqual (len (ti1s ), 0 )
2293
+ self .assertEqual (len (ti2s ), 2 )
2294
+ for t in ti2s :
2295
+ self .assertEqual (t .state , State .SUCCESS )
2296
+
2276
2297
def test_scheduler_multiprocessing (self ):
2277
2298
"""
2278
2299
Test that the scheduler can successfully queue multiple dags in parallel
Original file line number Diff line number Diff line change @@ -409,7 +409,7 @@ def test_paused(self):
409
409
def test_failed (self ):
410
410
url = ('failed?task_id=run_this_last&dag_id=example_bash_operator&'
411
411
'execution_date={}&upstream=false&downstream=false&future=false&past=false'
412
- .format (self .percent_encode (self .default_date )))
412
+ .format (self .percent_encode (self .EXAMPLE_DAG_DEFAULT_DATE )))
413
413
resp = self .client .get (url )
414
414
self .check_content_in_response ('Wait a minute' , resp )
415
415
You can’t perform that action at this time.
0 commit comments