testing-dags
Skill448 starsChanged 59 days agoApache-2.0View on GitHub
Complex DAG testing workflows with debugging and fixing cycles. Use for multi-step testing requests like "test this dag and fix it if it fails", "test and debug", "run the pipeline and troubleshoot issues". For simple test requests ("test dag", "run dag"), the airflow entrypoint skill handles it directly. This skill is for iterative test-debug-fix cycles.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- miptah21/skillsedited, first seen May 26, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- miptah21/skills★ 292% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- astro-airflow-mcp/AGENTS.mdAGENTS.md
- astro-airflow-mcp/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- airflow-hitlSkill
- airflow-pluginsSkill
- airflowSkill
- airflow-state-storeSkill
- analyzing-dataSkill
- annotating-task-lineageSkill
- authoring-dagsSkill
- authoring-go-sdk-tasksSkill
- authoring-java-sdk-tasksSkill
- authoring-language-sdk-tasksSkill
- blueprintSkill
- checking-freshnessSkill
- configuring-airflow-language-sdksSkill
- cosmos-dbt-coreSkill
- cosmos-dbt-fusionSkill
- creating-openlineage-extractorsSkill
- dag-factorySkill
- debugging-dagsSkill
- delegating-to-ottoSkill
- deploying-airflowSkill
- deploying-go-sdk-bundlesSkill
- deploying-java-sdk-bundlesSkill
- managing-astro-deploymentsSkill
- managing-astro-local-envSkill
- migrating-airflow-2-to-3Skill
- migrating-ai-sdk-to-common-aiSkill
- migrating-dagster-to-airflowSkill
- profiling-tablesSkill
- setting-up-astro-projectSkill
- tracing-downstream-lineageSkill
- tracing-upstream-lineageSkill
- troubleshooting-astro-deploymentsSkill
- warehouse-initSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
28 rules. About 0 are common, 21 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use af commands to test, debug, and fix DAGs in iterative cycles.
- Distinctive: line 18
If the user has the Astro CLI available, these commands provide fast feedback without needing a running Airflow instance:
- Distinctive: line 28
Use these for quick validation during development.
- Distinctive: line 34
When the user asks to test a DAG, your FIRST AND ONLY action should be:
- Very specific: line 44
Use grep or ls or any other bash command
- Distinctive: line 45
Do any "pre-flight checks"
- Distinctive: line 47
Just trigger the DAG: If it fails, THEN debug.
- Distinctive: line 77
Philosophy: Try first, debug on failure: Don't waste time on pre-flight checks — just run the DAG and diagnose if something goes wrong.
- Very specific: line 83
Use af runs trigger-wait to test the DAG:
- Distinctive: line 101
No manual polling required
- Distinctive: line 152
Use this only when you need more control:
- Very specific: line 180
Check current status: af runs get <dag_id> <dag_run_id>
- Distinctive: line 181
Ask user if they want to continue waiting
- Distinctive: line 192
When a DAG run fails, use these commands to diagnose:
- Distinctive: line 201
Run metadata (state, timing)
- Distinctive: line 202
All task instances with states
- Very specific: line 233
If a task shows upstream_failed, the root cause is in an upstream task.
- Distinctive: line 237
If the trigger failed because the DAG doesn't exist:
- Very specific: line 370
Check af config connections for correct host/port
- Distinctive: line 371
Verify network connectivity to external system
- Distinctive: line 372
Check if connection credentials are correct
- Distinctive: line 376
After adding, may need environment restart
- Distinctive: line 379
Check IAM roles, database grants, API keys
- Distinctive: line 380
Verify connection has correct credentials
- Distinctive: line 384
Consider adding timeout parameter to task
- Very specific: line 402
Dev deployment: Test DAGs freely with astro deploy --dags for fast iteration
- Distinctive: line 403
Staging deployment: Run integration tests against production-like data
- Distinctive: line 405
Use separate Astro deployments for each environment and promote code through them
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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:
# 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 pytestUse 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:
af runs trigger-wait <dag_id>DO NOT:
- Call
af dags listfirst - Call
af dags getfirst - Call
af dags errorsfirst - Use
greporlsor 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
af runs trigger-wait <dag_id> --timeout 300Example:
af runs trigger-wait my_dag --timeout 300Why 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:
{
"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:
{
"dag_run": {
"state": "failed"
},
"timed_out": false,
"elapsed_seconds": 30.1,
"failed_tasks": [
{
"task_id": "extract_data",
"state": "failed",
"try_number": 2
}
]
}Timeout:
{
"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:
# 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 current stateHandling Results
If Success
The DAG ran successfully. Summarize for the user:
- Total elapsed time
- Number of tasks completed
- Any notable outputs (if visible in logs)
You're done!
If Timed Out
The DAG is still running. Options:
- Check current status:
af runs get <dag_id> <dag_run_id> - Ask user if they want to continue waiting
- Increase timeout and try again
If Failed
Move to Phase 2 (Debug) to identify the root cause.
Phase 2: Debug Failures (Only If Needed)
When a DAG run fails, use these commands to diagnose:
Get Comprehensive Diagnosis
af runs diagnose <dag_id> <dag_run_id>Returns in one call:
- Run metadata (state, timing)
- All task instances with states
- Summary of failed tasks
- State counts (success, failed, skipped, etc.)
Get Task Logs
af tasks logs <dag_id> <dag_run_id> <task_id>Example:
af tasks logs my_dag manual__2025-01-14T... extract_dataFor specific retry attempt:
af tasks logs my_dag manual__2025-01-14T... extract_data --try 2Look for:
- Exception messages and stack traces
- Connection errors (database, API, S3)
- Permission errors
- Timeout errors
- Missing dependencies
Check Upstream Tasks
If a task shows upstream_failed, the root cause is in an upstream task. Use af runs diagnose to find which task actually failed.
Check Import Errors (If DAG Didn't Run)
If the trigger failed because the DAG doesn't exist:
af dags errorsThis reveals syntax errors or missing dependencies that prevented the DAG from loading.
Phase 3: Fix and Retest
Once you identify the issue:
Common Fixes
| Issue | Fix |
| Missing import | Add to DAG file |
| Missing package | Add to requirements.txt |
| Connection error | Check af config connections, verify credentials |
| Variable missing | Check af config variables, create if needed |
| Timeout | Increase task timeout or optimize query |
| Permission error | Check credentials in connection |
After Fixing
- Save the file
- Retest:
af runs trigger-wait <dag_id>
Repeat the test → debug → fix loop until the DAG succeeds.
CLI Quick Reference
| Phase | Command | Purpose |
| Test | af runs trigger-wait <dag_id> | Primary test method — start here |
| Test | af runs trigger <dag_id> | Start run (alternative) |
| Test | af runs get <dag_id> <run_id> | Check run status |
| Debug | af runs diagnose <dag_id> <run_id> | Comprehensive failure diagnosis |
| Debug | af tasks logs <dag_id> <run_id> <task_id> | Get task output/errors |
| Debug | af dags errors | Check for parse errors (if DAG won't load) |
| Debug | af dags get <dag_id> | Verify DAG config |
| Debug | af dags explore <dag_id> | Full DAG inspection |
| Config | af config connections | List connections |
| Config | af config variables | List variables |
Testing Scenarios
Scenario 1: Test a DAG (Happy Path)
af runs trigger-wait my_dag
# Success! Done.Scenario 2: Test a DAG (With Failure)
# 1. Run and wait
af runs trigger-wait my_dag
# Failed...
# 2. Find failed tasks
af runs diagnose my_dag manual__2025-01-14T...
# 3. Get error details
af tasks logs my_dag manual__2025-01-14T... extract_data
# 4. [Fix the issue in DAG code]
# 5. Retest
af runs trigger-wait my_dagScenario 3: DAG Doesn't Exist / Won't Load
# 1. Trigger fails - DAG not found
af runs trigger-wait my_dag
# Error: DAG not found
# 2. Find parse error
af dags errors
# 3. [Fix the issue in DAG code]
# 4. Retest
af runs trigger-wait my_dagScenario 4: Debug a Failed Scheduled Run
# 1. Get failure summary
af runs diagnose my_dag scheduled__2025-01-14T...
# 2. Get error from failed task
af tasks logs my_dag scheduled__2025-01-14T... failed_task_id
# 3. [Fix the issue]
# 4. Retest
af runs trigger-wait my_dagScenario 5: Test with Custom Configuration
af runs trigger-wait my_dag --conf '{"env": "staging", "batch_size": 100}' --timeout 600Scenario 6: Long-Running DAG
# Wait up to 1 hour
af runs trigger-wait my_dag --timeout 3600
# If timed out, check current state
af runs get my_dag manual__2025-01-14T...Debugging Tips
Common Error Patterns
Connection Refused / Timeout:
- Check
af config connectionsfor correct host/port - Verify network connectivity to external system
- Check if connection credentials are correct
ModuleNotFoundError:
- Package missing from
requirements.txt - After adding, may need environment restart
PermissionError:
- Check IAM roles, database grants, API keys
- Verify connection has correct credentials
Task Timeout:
- Query or operation taking too long
- Consider adding timeout parameter to task
- Optimize underlying query/operation
Reading Task Logs
Task logs typically show:
- Task start timestamp
- Any print/log statements from task code
- Return value (for @task decorated functions)
- Exception + full stack trace (if failed)
- Task end timestamp and duration
Focus on the exception at the bottom of failed task logs.
On Astro
Astro deployments support environment promotion, which helps structure your testing workflow:
- Dev deployment: Test DAGs freely with
astro deploy --dagsfor fast iteration - Staging deployment: Run integration tests against production-like data
- Production deployment: Deploy only after validation in lower environments
- Use separate Astro deployments for each environment and promote code through them
Related Skills
- authoring-dags: For creating new DAGs (includes validation before testing)
- debugging-dags: For general Airflow troubleshooting
- deploying-airflow: For deploying DAGs to production after testing
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

