kaxil commented on a change in pull request #7038: [AIRFLOW-4495] allow 
externally triggered dags to run for future exec dates
URL: https://github.com/apache/airflow/pull/7038#discussion_r367110594
 
 

 ##########
 File path: tests/ti_deps/deps/test_runnable_exec_date_dep.py
 ##########
 @@ -39,11 +41,56 @@ def test_exec_date_after_end_date(self):
         """
         If the dag's execution date is in the future this dep should fail
         """
-        ti = self._get_task_instance(
-            dag_end_date=datetime(2016, 1, 3),
-            task_end_date=datetime(2016, 1, 3),
-            execution_date=datetime(2016, 1, 2),
-        )
+        dag = DAG(
+            'test_localtaskjob_heartbeat',
+            start_date=datetime(2015, 1, 1),
+            end_date=datetime(2016, 11, 5),
+            schedule_interval=None)
+
+        with dag:
+            op1 = DummyOperator(task_id='op1')
+
+        ti = TaskInstance(task=op1, execution_date=datetime(2016, 11, 2))
+        self.assertFalse(RunnableExecDateDep().is_met(ti=ti))
+
+    @conf_vars({
+        ('scheduler', 'allow_trigger_in_future'): 'True'
+    })
+    @freeze_time('2016-01-01')
+    def test_exec_date_after_end_date_with_allow_config(self):
 
 Review comment:
   Maybe you could use `parameterized` as both the tests share almost the same 
code.
   
   You could parameterize `schedule_interval` and `execution_date` if you would 
like.
   
   tbh same execution date should work too

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to