
Testing Dags
Run iterative Airflow DAG test, debug, and fix cycles with the af CLI and Astro quick checks instead of one-shot test commands.
Overview
testing-dags is an agent skill for the Ship phase that orchestrates iterative Airflow DAG test, debug, and fix cycles using the af CLI, Astro dev parse/pytest, and trigger-wait runs.
Install
npx skills add https://github.com/astronomer/agents --skill testing-dagsWhat is this skill?
- FIRST ACTION: run `af runs trigger-wait <dag_id>` with no pre-flight dags list/get/errors or grep/ls
- Quick local validation via `astro dev parse` and `astro dev pytest` when Astro CLI is available
- Iterative test-debug-fix cycles for complex prompts; simple test/run requests defer to the airflow entrypoint skill
- af CLI via `astro otto` on PATH or `uv tool install astro-airflow-mcp` for standalone install
- End-to-end trigger-and-wait against a live Airflow instance after optional Astro dev checks
- 2 Astro CLI quick-validation commands: astro dev parse and astro dev pytest
- Documented FIRST ACTION: af runs trigger-wait <dag_id> with explicit do-not pre-flight list
Adoption & trust: 791 installs on skills.sh; 384 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need to prove an Airflow DAG works end-to-end and repair failures without the agent burning steps on pre-flight listing or treating a complex debug loop like a one-shot test command.
Who is it for?
Solo or indie builders on Astronomer/Airflow projects who paste multi-step prompts such as test this DAG and fix it if it fails and want a disciplined af-first workflow.
Skip if: Simple test dag or run dag requests (use the airflow entrypoint skill), environments without af/astro otto or a runnable Airflow target, or teams that only need static lint without run validation.
When should I use this skill?
Complex DAG testing workflows with debugging and fixing cycles—e.g. test this dag and fix it if it fails, test and debug, run the pipeline and troubleshoot issues; not for simple test dag or run dag requests.
What do I get? / Deliverables
The agent triggers and waits on DAG runs, applies Astro parse/pytest when available, and repeats debug-and-fix steps until the pipeline passes or remaining blockers are spelled out.
- Completed or failed trigger-wait run with actionable debug notes
- DAG or test fixes applied across iterative cycles
- Optional parse/pytest pass before live trigger-wait
Recommended Skills
Journey fit
The skill is built around validating pipeline behavior, waiting on runs, and troubleshooting failures—work that belongs on the Ship phase shelf as pre-release QA, not initial idea research or growth analytics. Testing is the right subphase because SKILL.md targets multi-step requests like test-and-debug and test-and-fix, with pytest/parse and trigger-wait as the core loop rather than security review or launch distribution.
How it compares
Use this for iterative test-debug-fix cycles; use the airflow entrypoint skill for direct single-shot test or run requests without a fix loop.
Common Questions / FAQ
Who is testing-dags for?
It is for solo and indie builders (and small data teams) who ship Airflow DAGs with Astronomer tooling and want an agent to own multi-step testing and troubleshooting, not just fire one CLI command.
When should I use testing-dags?
Use it in Ship (testing) when you need test-and-debug or test-and-fix cycles, trigger-wait validation against a live instance, or Astro dev parse/pytest before deeper troubleshooting—especially after changes in Build (integrations/backend) to pipeline code.
Is testing-dags safe to install?
It instructs the agent to run shell CLI against your Airflow project and live runs; review the Security Audits panel on this Prism page and treat DAG code and connection secrets like any production-adjacent tooling before granting agent access.
SKILL.md
READMESKILL.md - Testing Dags
# DAG Testing Skill Use `af` commands to test, debug, and fix DAGs in iterative cycles. ## Running the CLI These commands assume `af` is on PATH. Run via `astro otto` to get it automatically, or install standalone with `uv tool install astro-airflow-mcp`. --- ## Quick Validation with Astro CLI If the user has the Astro CLI available, these commands provide fast feedback without needing a running Airflow instance: ```bash # Parse DAGs to catch import errors, syntax issues, and DAG-level problems astro dev parse # Run pytest against DAGs (runs tests in tests/ directory) astro dev pytest ``` Use these for quick validation during development. For full end-to-end testing against a live Airflow instance, continue to the trigger-and-wait workflow below. --- ## FIRST ACTION: Just Trigger the DAG When the user asks to test a DAG, your **FIRST AND ONLY action** should be: ```bash af runs trigger-wait <dag_id> ``` **DO NOT:** - Call `af dags list` first - Call `af dags get` first - Call `af dags errors` first - Use `grep` or `ls` or any other bash command - Do any "pre-flight checks" **Just trigger the DAG.** If it fails, THEN debug. --- ## Testing Workflow Overview ``` ┌─────────────────────────────────────┐ │ 1. TRIGGER AND WAIT │ │ Run DAG, wait for completion │ └─────────────────────────────────────┘ ↓ ┌───────┴───────┐ ↓ ↓ ┌─────────┐ ┌──────────┐ │ SUCCESS │ │ FAILED │ │ Done! │ │ Debug... │ └─────────┘ └──────────┘ ↓ ┌─────────────────────────────────────┐ │ 2. DEBUG (only if failed) │ │ Get logs, identify root cause │ └─────────────────────────────────────┘ ↓ ┌─────────────────────────────────────┐ │ 3. FIX AND RETEST │ │ Apply fix, restart from step 1 │ └─────────────────────────────────────┘ ``` **Philosophy: Try first, debug on failure.** Don't waste time on pre-flight checks — just run the DAG and diagnose if something goes wrong. --- ## Phase 1: Trigger and Wait Use `af runs trigger-wait` to test the DAG: ### Primary Method: Trigger and Wait ```bash af runs trigger-wait <dag_id> --timeout 300 ``` **Example:** ```bash af runs trigger-wait my_dag --timeout 300 ``` **Why this is the preferred method:** - Single command handles trigger + monitoring - Returns immediately when DAG completes (success or failure) - Includes failed task details if run fails - No manual polling required ### Response Interpretation **Success:** ```json { "dag_run": { "dag_id": "my_dag", "dag_run_id": "manual__2025-01-14T...", "state": "success", "start_date": "...", "end_date": "..." }, "timed_out": false, "elapsed_seconds": 45.2 } ``` **Failure:** ```json { "dag_run": { "state": "failed" }, "timed_out": false, "elapsed_seconds": 30.1, "failed_tasks": [ { "task_id": "extract_data", "state": "failed", "try_number": 2 } ] } ``` **Timeout:** ```json { "dag_id": "my_dag", "dag_run_id": "manual__...", "state": "running", "timed_out": true, "elapsed_seconds": 300.0, "message": "Timed out after 300 seconds. DAG run is still running." } ``` ### Alternative: Trigger and Monitor Separately Use this only when you need more control: ```bash # Step 1: Trigger af runs trigger my_dag # Returns: {"dag_run_id": "manual__...", "state": "queued"} # Step 2: Check status af runs get my_dag manual__2025-01-14T... # Returns cu