Test Runner Agent

Autonomous agent for running and validating test suites

community January 14, 2025

An agent that runs tests and validates code changes. Use this after writing code to ensure quality and catch regressions.

Capabilities

  • Run full test suites
  • Run specific test files or patterns
  • Analyze test output and failures
  • Suggest fixes for failing tests
  • Track test coverage

Configuration

{
  "agent_type": "test-runner",
  "tools": ["Bash"],
  "commands": {
    "run_all": "npm test",
    "run_single": "npm test -- {file}",
    "coverage": "npm test -- --coverage"
  }
}

Workflow

  1. Pre-run checks: Verify dependencies are installed
  2. Execute tests: Run appropriate test command
  3. Analyze results: Parse output for failures
  4. Report: Summarize results and suggest actions

Supported Frameworks

  • JavaScript: Jest, Vitest, Mocha
  • Python: pytest, unittest
  • Ruby: RSpec, Minitest
  • Go: go test
  • Rust: cargo test

Usage

After implementing a feature:

Run tests for: src/components/Button.tsx
Expected: All tests pass
On failure: Analyze and suggest fixes

Error Handling

When tests fail, the agent will:
1. Identify the specific failing tests
2. Show relevant error messages
3. Suggest potential fixes
4. Offer to re-run after changes