You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2020/06/29 14:17:12 UTC
[airflow] branch master updated: Fix failing test in DagCode (#9565)
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new ee03353 Fix failing test in DagCode (#9565)
ee03353 is described below
commit ee0335315e421c8ce9e826f7ac5e8f4c82f171fe
Author: Kaxil Naik <ka...@gmail.com>
AuthorDate: Mon Jun 29 15:16:41 2020 +0100
Fix failing test in DagCode (#9565)
PR https://github.com/apache/airflow/pull/9554 introduced this error and because of Github issue currently (github is down / has degraded performance) the CI didn't run fully
---
tests/models/test_dagcode.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/models/test_dagcode.py b/tests/models/test_dagcode.py
index 728da3a..77a1cfc 100644
--- a/tests/models/test_dagcode.py
+++ b/tests/models/test_dagcode.py
@@ -54,6 +54,7 @@ class TestDagCode(unittest.TestCase):
return [bash_dag, xcom_dag]
@conf_vars({('core', 'store_dag_code'): 'True'})
+ @patch("airflow.models.dag.settings.STORE_DAG_CODE", True)
def _write_example_dags(self):
example_dags = make_example_dags(example_dags_module)
for dag in example_dags.values():
@@ -66,6 +67,7 @@ class TestDagCode(unittest.TestCase):
self._compare_example_dags(example_dags)
+ @conf_vars({('core', 'store_dag_code'): 'True'})
def test_bulk_sync_to_db(self):
"""Dg code can be bulk written into database."""
example_dags = make_example_dags(example_dags_module)
@@ -76,6 +78,7 @@ class TestDagCode(unittest.TestCase):
self._compare_example_dags(example_dags)
+ @conf_vars({('core', 'store_dag_code'): 'True'})
def test_bulk_sync_to_db_half_files(self):
"""Dg code can be bulk written into database."""
example_dags = make_example_dags(example_dags_module)
@@ -135,6 +138,8 @@ class TestDagCode(unittest.TestCase):
self.assertEqual(result.source_code, source_code)
@conf_vars({('core', 'store_dag_code'): 'True'})
+ @patch("airflow.models.dag.settings.STORE_DAG_CODE", True)
+ @patch("airflow.models.dagcode.STORE_DAG_CODE", True)
def test_code_can_be_read_when_no_access_to_file(self):
"""
Test that code can be retrieved from DB when you do not have access to Code file.
@@ -152,6 +157,7 @@ class TestDagCode(unittest.TestCase):
self.assertIn(test_string, dag_code)
@conf_vars({('core', 'store_dag_code'): 'True'})
+ @patch("airflow.models.dag.settings.STORE_DAG_CODE", True)
def test_db_code_updated_on_dag_file_change(self):
"""Test if DagCode is updated in DB when DAG file is changed"""
example_dag = make_example_dags(example_dags_module).get('example_bash_operator')