You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Stefan Seelmann (JIRA)" <ji...@apache.org> on 2018/09/22 19:00:00 UTC
[jira] [Commented] (AIRFLOW-7) Unit test for ExternalTaskSensor
depends on a different unit test
[ https://issues.apache.org/jira/browse/AIRFLOW-7?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16624787#comment-16624787 ]
Stefan Seelmann commented on AIRFLOW-7:
---------------------------------------
Seems to be fixed, {{self.test_time_sensor()}} is now called explicitely: https://github.com/apache/incubator-airflow/blob/master/tests/sensors/test_external_task_sensor.py#L188
> Unit test for ExternalTaskSensor depends on a different unit test
> -----------------------------------------------------------------
>
> Key: AIRFLOW-7
> URL: https://issues.apache.org/jira/browse/AIRFLOW-7
> Project: Apache Airflow
> Issue Type: Bug
> Components: tests
> Reporter: Jeremiah Lowin
> Priority: Minor
> Labels: test
>
> The unit test {{core:CoreTest.test_external_task_sensor}} appears to depend on the result of a different unit test. I discovered this when I created a {{tearDown()}} method that deleted any TaskInstances created by a unit test. I think it's bad to have cross-test dependencies, especially since I'm not sure if there is a guarantee about unit test run order.
> Full test:
> {code}
> def test_external_task_sensor_delta(self):
> t = operators.ExternalTaskSensor(
> task_id='test_external_task_sensor_check_delta',
> external_dag_id=TEST_DAG_ID,
> external_task_id='time_sensor_check',
> execution_delta=timedelta(0),
> allowed_states=['success'],
> dag=self.dag)
> t.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, force=True)
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)