Testing DAGs and CI/CD
Import, policy, unit and end-to-end tests, and a deploy pipeline for DAG repositories.
Pipelines in production · Airflow · Gold · Running Airflow in production, lesson 3 of 4
On this page
Read first: Running Airflow 3 on your laptop · Testing PySpark code (skip if you know them)
In plain words first
Before a play opens, the cast checks the script has no missing pages, rehearses each scene alone, and runs one full dress rehearsal. Each check catches a different kind of mistake, and the cheap ones run first.
DAGDAG: A pipeline in Airflow: a set of tasks and the order they run in, defined in a Python file and run on a schedule. Learn more → tests work the same way: import checks, policy checks, tasktask: One step of a DAG, such as running a query or calling an API. Each run of a task for one date is a task instance. Learn more → tests, and a full test run.
Unlock the full lesson
You have read the free part. The rest of this advanced lesson:
- Four levels of tests
- Import and policy tests
- Unit testing task logic
- One run, end to end
- The deploy pipeline
- Common mistakes
- Key takeaways
- Interview prep with 3 follow-up questions
- Check yourself: 3 questions
Unlock it with the Complete pass (every advanced problem and lesson) or on its own.
Keep going
Up next · Running Airflow in production · lesson 4 of 4 · 5 min readMigrating from Airflow 2 to 3
What breaks, what still works with a warning, and what changes without any error.
Related lessons
Running Airflow 3 on your laptopPySpark functions · 6 min read
Testing PySpark code
Previous: Airflow 3 architecture in production
Primary sources: Testing a DAG · Ruff Airflow rules