Skip to main content

/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
ArgumentRequiredDescription
test sourceNoPath to qa-test-generate output or test directory
--unitNoRun unit tests only
--integrationNoRun integration tests only
--e2eNoRun E2E tests only
--allNoRun all tiers (default)
--mutationNoRun mutation testing (StrykerJS/Infection/go-mutesting)
--contractNoDelegate API contract validation to /qa-contract-validate

When run without arguments, launches an interactive wizard.

Note: The --contract tier delegates to /qa-contract-validate rather than executing contract tools directly.


What It Produces

Files at $JAAN_OUTPUTS_DIR/qa/test-run/{id}-{slug}/:

FileContent
{id}-{slug}.mdTest execution report with coverage data

The report includes:

  • Test results per tier (pass/fail/skip counts)
  • Coverage percentages (line, branch)
  • Mutation score (when --mutation is used): killed/survived/total mutant counts and mutation score percentage
  • Mutation iteration tracking (when --mutation is used): iteration count, score progression across runs
  • Failure analysis by category
  • Auto-fix summary
  • Suggested fixes for manual failures
  • Coverage gaps

What It Asks

QuestionWhenWhy
Test file locationNo input providedNeed to find tests
Tier filterAmbiguous scopeUnit / integration / E2E / all
Environment valuesMissing .env.testDB URL, API keys for test env
Coverage thresholdsNot in configTeam-specific standards

Failure Diagnosis

Categorizes failures for targeted fixes:

CategoryAuto-FixExamples
Import/ModuleYesMissing modules, wrong paths
ORM/DB clientYesPrisma not generated, migrations pending
EnvironmentYes (asks values)Missing env vars
AssertionNoBusiness logic mismatches
Timeout/AsyncSuggestMissing await, goroutine leaks
Database/StateSuggestMissing seed data, connection refused
Mock/FixtureSuggestStale snapshots, missing handlers

Multi-Stack Support

StackTest RunnerE2E RunnerCoverage Tool
Node.js / TypeScriptVitest / JestPlaywright / Cypress@vitest/coverage-v8 / istanbul
PHPPHPUnit / PestLaravel Dusk / CodeceptionXdebug / PCOV
Gogo testRod / Chromedpgo 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-generate first to create test files
  • Use --unit for 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)


Technical Details

  • Logical Name: qa-test-run
  • Command: /qa-test-run
  • Role: qa
  • Output: $JAAN_OUTPUTS_DIR/qa/test-run/{id}-{slug}/