From 998c2cdf475ae59c4957ca0cc1cdc13261b9bef6 Mon Sep 17 00:00:00 2001 From: Pankaj Date: Wed, 31 Jul 2024 02:49:48 +0530 Subject: [PATCH] Ignore kubernetes dag --- tests/test_example_dags.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_example_dags.py b/tests/test_example_dags.py index cb246fbf9..50e294bd6 100644 --- a/tests/test_example_dags.py +++ b/tests/test_example_dags.py @@ -24,7 +24,7 @@ AIRFLOW_IGNORE_FILE = EXAMPLE_DAGS_DIR / ".airflowignore" DBT_VERSION = Version(get_dbt_version().to_version_string()[1:]) AIRFLOW_VERSION = Version(airflow.__version__) -KUBERNETES_DAG_FILES = ["jaffle_shop_kubernetes.py"] +KUBERNETES_DAGS = ["jaffle_shop_kubernetes"] MIN_VER_DAG_FILE: dict[str, list[str]] = { "2.4": ["cosmos_seed_dag.py"], @@ -55,9 +55,6 @@ def session(): def get_dag_bag() -> DagBag: """Create a DagBag by adding the files that are not supported to .airflowignore""" - with open(AIRFLOW_IGNORE_FILE, "w+") as file: - file.writelines([f"{dag_file}\n" for dag_file in KUBERNETES_DAG_FILES]) - if AIRFLOW_VERSION in PARTIALLY_SUPPORTED_AIRFLOW_VERSIONS: return DagBag(dag_folder=None, include_examples=False) @@ -97,6 +94,8 @@ def get_dag_ids() -> list[str]: @pytest.mark.integration @pytest.mark.parametrize("dag_id", get_dag_ids()) def test_example_dag(session, dag_id: str): + if dag_id in KUBERNETES_DAGS: + return dag_bag = get_dag_bag() dag = dag_bag.get_dag(dag_id) test_utils.run_dag(dag)