Skip to content

Commit

Permalink
Ignore kubernetes dag
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajastro committed Jul 30, 2024
1 parent f465eca commit 998c2cd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/test_example_dags.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

0 comments on commit 998c2cd

Please sign in to comment.