run-local-tests

Runs Python, frontend, and end-to-end test suites and diagnoses wedged local test infrastructure.

1|Updated Aug 14, 2026
One-click install
npx skills add https://github.com/zhiyuan-zhang0206/Ava --skill run-local-tests-zhiyuan-zhang0206
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: run-local-tests
Source: https://github.com/zhiyuan-zhang0206/Ava/tree/main/.agents/skills/run-local-tests
Command: npx skills add https://github.com/zhiyuan-zhang0206/Ava --skill run-local-tests-zhiyuan-zhang0206

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Local test runs fail or silently mislead when pytest, initdb, Postgres, or cleanup processes misbehave — leaked throwaway Postgres clusters wedge the box, shared venvs get corrupted by symlinks, and tests pass for the wrong reasons. This Skill encodes the correct commands, isolation rules, and recovery procedures for the Ava repo's test infrastructure. ## Core Features & Use Cases - Layered test execution: Runs the right scope per change — pre-commit lint hooks, targeted pytest for touched areas, frontend vitest/eslint/tsc checks, and full e2e suites with real gateway, agent subprocess, Next.js, and Playwright Chromium. - Wedged infrastructure recovery: Diagnoses and sweeps leaked throwaway Postgres clusters that exhaust macOS System V shared memory (shmmni), using flock-based owner locks and path-based identification to avoid killing real clusters. - Test integrity guardrails: Enforces proving new tests fail without the fix, verifying end-to-end results externally rather than trusting agent self-reports, and safe pkill discipline anchored to instance directories. - Use Case: Before pushing a change to shared/, run the full non-e2e pytest suite, confirm your new regression test goes red against the pre-fix code, then push knowing CI will not surprise you. ## Quick Start Run the local tests for the files I just changed and tell me whether anything failed before I push.

Frequently Asked Questions about run-local-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run local tests before pushing code?▼

Run pytest on the touched test files with .venv/bin/pytest, and for frontend changes run vitest, eslint, next typegen, and tsc in ui/web. For changes in shared/, run the full non-e2e suite since its blast radius covers all consumers.

Why does initdb or pg_ctl fail on my Mac after many test runs?▼

Interrupted test runs leak detached throwaway Postgres postmasters, each holding a System V shared-memory segment, and macOS limits kern.sysv.shmmni to 32. Sweep orphaned clusters via shared.pg_tools.sweep_orphaned_throwaway_clusters to free segments.

Can I symlink a shared virtualenv into a new git worktree?▼

No. A symlinked .venv lets a later uv sync write through the link and re-point the shared venv's editable .pth, breaking every other checkout. Build the worktree's own venv or reuse another worktree's real venv with PYTHONPATH pointing at this worktree.

How do I prove a new regression test actually catches the bug?▼

Check out the pre-fix version of the file with git checkout <sha-before-fix> -- <file>, re-run the test, and confirm it fails, then restore with git checkout HEAD -- <file>. Do not use git stash, which stashes nothing against a committed fix and fakes the proof.

Why is pkill -f dangerous during test cleanup?▼

pkill -f matches any command line containing the substring, so a pattern like a config filename can kill production processes alongside test residue. Kill by exact PID from a pidfile you own, or anchor the pattern to the absolute temp directory the cleanup created.

How do end-to-end tests avoid conflicting with a running dev environment?▼

E2E tests use dedicated ports (gateway 8001, frontend 3001), a throwaway per-worker Postgres, a separate Redis channel, and an isolated AVA_HOME under tmp/ava_e2e_home. They can run concurrently with dev but not in parallel with themselves.