/qa-test-run
Execute tests across stacks, diagnose failures, auto-fix simple issues, and generate coverage reports.
Overview
Executes test suites generated by /qa-test-generate (or existing project tests), diagnoses failures into categories, auto-fixes infrastructure issues, and produces structured coverage reports. Supports Node.js/TypeScript (Vitest, Jest, Playwright), PHP (PHPUnit, Pest, Laravel Dusk), and Go (go test). Uses tech.md for stack detection.
Usage
/qa-test-run
/qa-test-run path/to/test-generate-output
/qa-test-run tests/ --unit
/qa-test-run tests/ --mutation
/qa-test-run tests/ --contract
/qa-test-run tests/ --all
| Argument | Required | Description |
|---|---|---|
| test source | No | Path to qa-test-generate output or test directory |
--unit | No | Run unit tests only |
--integration | No | Run integration tests only |
--e2e | No | Run E2E tests only |
--all | No | Run all tiers (default) |
--mutation | No | Run mutation testing (StrykerJS/Infection/go-mutesting) |
--contract | No | Delegate API contract validation to /qa-contract-validate |
When run without arguments, launches an interactive wizard.
Note: The
--contracttier delegates to/qa-contract-validaterather than executing contract tools directly.
What It Produces
Files at $JAAN_OUTPUTS_DIR/qa/test-run/{id}-{slug}/:
| File | Content |
|---|---|
{id}-{slug}.md | Test execution report with coverage data |
The report includes:
- Test results per tier (pass/fail/skip counts)
- Coverage percentages (line, branch)
- Mutation score (when
--mutationis used): killed/survived/total mutant counts and mutation score percentage - Mutation iteration tracking (when
--mutationis used): iteration count, score progression across runs - Failure analysis by category
- Auto-fix summary
- Suggested fixes for manual failures
- Coverage gaps
What It Asks
| Question | When | Why |
|---|---|---|
| Test file location | No input provided | Need to find tests |
| Tier filter | Ambiguous scope | Unit / integration / E2E / all |
| Environment values | Missing .env.test | DB URL, API keys for test env |
| Coverage thresholds | Not in config | Team-specific standards |
Failure Diagnosis
Categorizes failures for targeted fixes:
| Category | Auto-Fix | Examples |
|---|---|---|
| Import/Module | Yes | Missing modules, wrong paths |
| ORM/DB client | Yes | Prisma not generated, migrations pending |
| Environment | Yes (asks values) | Missing env vars |
| Assertion | No | Business logic mismatches |
| Timeout/Async | Suggest | Missing await, goroutine leaks |
| Database/State | Suggest | Missing seed data, connection refused |
| Mock/Fixture | Suggest | Stale snapshots, missing handlers |
Multi-Stack Support
| Stack | Test Runner | E2E Runner | Coverage Tool |
|---|---|---|---|
| Node.js / TypeScript | Vitest / Jest | Playwright / Cypress | @vitest/coverage-v8 / istanbul |
| PHP | PHPUnit / Pest | Laravel Dusk / Codeception | Xdebug / PCOV |
| Go | go test | Rod / Chromedp | go test -cover |
Stack is auto-detected from tech.md or lockfiles.
Workflow Chain
/qa-test-generate --> /qa-test-run
Example
Input:
/qa-test-run path/to/test-generate/01-user-auth/ --all
Output:
jaan-to/outputs/qa/test-run/01-user-auth/
└── 01-user-auth.md (execution report)
Report summary:
Total: 42 tests | Passed: 38 | Failed: 4 | Auto-Fixed: 2
Coverage: 82% line, 71% branch
Tips
- Run
/qa-test-generatefirst to create test files - Use
--unitfor fast feedback during development - Auto-fix handles infrastructure issues; assertion failures require manual fixes
- Coverage is parsed per stack (Istanbul/v8, PHPUnit XML, go tool cover)
Related Skills
- /qa-test-generate - Generate runnable test files
- /qa-test-cases - Generate BDD/Gherkin test cases
- /qa-test-mutate - Mutation testing to find surviving mutants (feeds
--mutationmode)
Technical Details
- Logical Name: qa-test-run
- Command:
/qa-test-run - Role: qa
- Output:
$JAAN_OUTPUTS_DIR/qa/test-run/{id}-{slug}/