← All tools

Code Engineering

Test Runner

Auto-detect a project's test framework and run the suite, returning truncated output + exit code.

test_runner

Overview

The 'mvn test' / 'pytest -q' / 'cargo test' button. Lets the agent run the test suite without having to know what test framework the repo uses.

How it works

Returns up to MAX_OUTPUT_CHARS of combined stdout+stderr plus the exit code. Default timeout 300s. The agent may override detection with runner=mvn (etc.) — handy for monorepos where the marker-file heuristic picks the wrong one.

Example

When a user asks:

Run the tests and report failures.

the agent calls the tool:

test_runner()

and gets back: exit=1 — 142 tests, 2 failures: UserServiceTest#shouldRejectExpiredToken, OrderRepositoryTest#paginationOffset

What it's good for

Real scenarios where agents put this tool to work.

Test → diagnose → patch → re-test loop inside a self-improving agent
Pre-commit verification gate driven by a reviewer agent
Smoke-running a generated fix before submitting it as a PR via github_create_pr

Source

Implementation lives at swarmai-tools/src/main/java/ai/intelliswarm/swarmai/tool/code/build/TestRunnerTool.java in the swarm-ai repository.

Open test_runner on GitHub →