Skip to content
Agentmart
Submit a tool

af-test

Write tests for Airflow backend API endpoints following project conventions.

Skill by guan404ming

IndexedApache-2.0★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/guan404ming-af-test

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Write tests for Airflow backend API endpoints following project conventions.

Use cases: backend, testing, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/af-test

What's inside

Skill name
af-test
Description
Write tests for Airflow backend API endpoints following project conventions.
License
Apache-2.0
Instructions
54 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Airflow Test Writer

Write tests for Airflow backend API endpoints.

## Usage
```
/af-test <endpoint file path or description>
```

## Test Location

Tests mirror the source tree:
- `airflow-core/src/airflow/api_fastapi/core_api/routes/ui/foo.py`
- `airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_foo.py`

## Conventions

### Structure
- One test class per endpoint, named `Test<EndpointFunction>` (e.g. `TestGetPartitionedDagRuns`)
- All test methods inside the class, with descriptive names
- Auth tests in every class: `test_should_response_401`, `test_should_response_403`
- Use `pytestmark = pytest.mark.db_test` at module level
- Use `@pytest.fixture(autouse=True)` for cleanup

### Parametrize over separate methods
- Prefer one parametrized test over multiple methods with similar setup
- Use `@pytest.mark.parametrize` with `ids` for all variants
- Vary inputs (counts, booleans, enums) and derive expected values in the test body
- Keep assertions generic enough to work across all parameter combinations

Example: instead of `test_pending`, `test_fulfilled`, `test_partial`, write one `test_should_response_200` parametrized on `(num_assets, received_count, fulfilled)`.

### Fixtures and helpers
- Use `dag_maker` fixture to create DAGs, call `dag_maker.sync_dagbag_to_db()` after
- Use `session` fixture for direct DB operations (add, flush, commit)
- Use `test_client` for authenticated requests, `unauthenticated_test_client` / `unauthorized_test_client` for auth tests
- Use `assert_queries_count` to verify query efficiency where existing tests do
- Cleanup helpers from `tests_common.test_utils.db`: `clear_db_dags`, `clear_db_serialized_dags`, `clear_db_apdr`, `clear_db_pakl`, etc.

## Instructions

1. **Read the endpoint code** to understand the route, parameters, response model, and dependencies.

2. **Read 1-2 existing test files** in the same directory to match the local style. Use the closest neighbor (e.g. `test_assets.py` for asset-related endpoints).

3. **Write the test file** with:
   - Auth tests (401, 403) for each endpoint class
   - 404 for missing resources
   - One parametrized 200 test covering: happy path, edge cases (empty/partial data), and relevant filter/flag combinations
   - Separate parametrized tests only when the setup or assertions differ significantly

4. **Run ruff:** `prek .:ruff` to fix lint issues.

From guan404ming/gmccc, Apache-2.0.

More from guan404ming/gmccc

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Feb 11, 2026 (8 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from guan404ming

Cite this page

af-test skill. Agent Mart. https://agentmart.dev/skills/guan404ming-af-test (last updated 2026-10-24)