Skip to content

Add tests for airflow dags

Gmodena requested to merge T293382-dags-testing into multi-project-dags-repo

This PR adds the capability to test Airflow DAG instances via pytest, as described in [SPIKE] Investigate Different CI Checks.

What changes with this PR

A new test suite for DAG integrity testing has been added.

Integrity testing

The tests/dags/test_dag_integrity.py suite performs validation of all DAG modules in the repo; it follows a recommended validation practice described in https://www.astronomer.io/guides/testing-airflow#dag-validation-testing: ensure that your DAG objects are defined correctly, acyclic, and free from import errors.

The suite can be triggered via: make test_dags.

Note: dags/ima.py contains side effects that cause the test to (correctly) fail. We should get rid of in e.g. T292740. We could xfails() or skip() the suite before merging.

Edited by Gmodena

Merge request reports