agnilisted
Install: claude install-skill arjuncrevathi/asthra
# Agni — Trial by Fire (Testing)
Agni governs the fire every change must pass through before it is trusted.
## The pyramid
- Many unit tests (fast, no I/O), some integration tests (real DB via testcontainers/Docker), few e2e tests (critical user flows only).
- Unit suite runs in seconds and on every save; the full suite runs in CI on every PR (see `brahma`).
- Coverage is a smoke alarm, not a goal: alert on drops, don't chase 100%. Untested error paths matter more than tested getters.
## What to test
- Test behavior through public interfaces, not implementation. A refactor that preserves behavior should break zero tests.
- Every bug fix gets a regression test that fails on the old code, in the same PR (see `durga`).
- Name tests as claims: `test_expired_token_returns_401`, not `test_auth_2`.
- Cover the unhappy paths: empty input, timeout, malformed data, permission denied.
## Tools
- Python: `pytest`. Shared setup lives in fixtures (`conftest.py`), not copy-paste. Use `pytest.mark.parametrize` for input matrices; `factory-boy`/builders for test data.
- JS/TS: `vitest` for unit/component (with Testing Library), `playwright` for e2e. Query by role/label, not CSS selectors.
- Mock external services at the boundary only — the HTTP layer (`respx`, `msw`) or your adapter interface. Never mock your own domain logic; if you must, the design is wrong (see `vishwakarma`).
## Flakes
- No flaky tests. A test that fails 1-in-20 runs gets fixed today or deleted — retrying-until-g