- Home
- Skills
- Astronomer
- Agents
- Testing Dags
testing-dags_skill
- Python
251
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill astronomer/agents --skill testing-dags- SKILL.md10.4 KB
Overview
This skill runs iterative test–debug–fix cycles for complex Airflow DAGs. It is designed for multi-step requests like “test this DAG and fix it if it fails,” where a single-run tool is insufficient. The workflow prioritizes triggering the run first, then diagnosing and applying fixes only when failures occur.
How this skill works
Start by triggering the DAG run with a single command that both launches and waits for completion. If the run succeeds, report elapsed time and completed tasks. If it fails or times out, gather diagnostics and task logs to identify the root cause, apply a code or configuration fix, and then re-run the DAG. Repeat until the DAG succeeds.
When to use it
- You need an iterative test-debug-fix loop for a DAG (not a simple one-off run).
- The DAG is complex and may fail for code, dependency, or infra reasons that require inspection and fixes.
- You expect multiple cycles of testing and repairs rather than a single status check.
- You want scripted, reproducible debugging commands for failed runs.
Best practices
- Always start with af runs trigger-wait <dag_id> as the first and only initial action.
- Only run diagnostics if the trigger-wait indicates failure or timeout.
- Use af runs diagnose to get a comprehensive failure summary before inspecting individual logs.
- Inspect task logs with af tasks logs <dag_id> <run_id> <task_id> and check the bottom of the trace for the exception.
- After fixes, retest using the same trigger-wait command and iterate until success.
Example use cases
- "Test this DAG and fix it if it fails" — run trigger-wait, diagnose failures, patch code/config, retest.
- Debug intermittent upstream failures: trigger, find upstream_failed, inspect the real failing upstream task with diagnose and logs.
- Resolve parse/import issues: trigger-wait shows DAG missing, run af dags errors, fix imports, retest.
- Long-running pipeline troubleshooting: run trigger-wait with increased --timeout, or diagnose after a timeout then continue or extend timeout.
FAQ
Always run af runs trigger-wait <dag_id> as your first and only initial action. Only debug if that run fails or times out.
How do I get full context when a run fails?
Use af runs diagnose <dag_id> <run_id> for a full summary, then af tasks logs <dag_id> <run_id> <task_id> for task-level stack traces and errors.