gotestsum
$ gotestsum Community Low Riskgotestsum wraps go test -json to deliver readable terminal summaries, automatic failure reruns via --rerun-fails, and machine-readable artifacts via --jsonfile and --junitfile. Non-interactive execution and clear exit codes make it ideal for coding agents verifying Go changes.
brew install gotestsum Local Go test runner tightly coupled to your repo and go toolchain; agents run gotestsum directly in the workspace.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --format standard-json, --jsonfile, --junitfile, NO_COLOR, and non-interactive exit codes, though --watch must be avoided by agents.
- Structured
--format standard-jsonand--jsonfileoutput - Compact
--format pkgname-and-test-failsreduces log noise
Zero credentials or remote writes; executes local go test code and only writes report files when --junitfile or --jsonfile is passed.
- No auth required; strictly local workspace execution
Single static Go binary available via brew install gotestsum and go install across macOS, Linux, and Windows.
- Cross-platform binary with Homebrew and Go module install
Improves heavily over raw go test with failure-only summaries, --rerun-fails for flaky tests, and JUnit/JSON artifact generation.
- Built-in
--rerun-failsand JUnit/JSON reporters
Well-maintained community Go tool (gotestyourself/gotestsum) under the Apache-2.0 license.
- Widely adopted in Go CI pipelines
Clear --help output and concise README documentation covering formatters and flags.
- Self-contained
--helpflag reference
Security, Auth & Guardrails
No credentials required; runs local Go test suites using the local go toolchain.
Apache-2.0 open-source CLI; completely free.
# gotestsum Agent Rules - Prefer `--format pkgname-and-test-fails` or `--format standard-json` with `NO_COLOR=1`. - Avoid `--watch` mode inside non-interactive agent loops. - Pass explicit package targets after `--` when scoping fast test runs.
Agent-Ready Command Recipes
Safe Read-Only Queries
gotestsum --format standard-json -- ./...
Streams go test -json events for structured parsing without writing report files.
NO_COLOR=1 gotestsum --format pkgname-and-test-fails -- ./...
Emits compact per-package status and only failing test details to preserve agent context.
Controlled Writes & Previews
gotestsum --format dots --junitfile reports/junit.xml --jsonfile reports/events.json -- ./...
Persists structured JUnit XML and JSON test event logs under reports/ for downstream inspection.
Strengths for Agents
- +
--format pkgname-and-test-failskeeps failing test output compact for LLM context windows. - + Outputs both
go test -jsonstreams (--jsonfile) and CI-ready--junitfileXML. - + Supports
--rerun-failsto isolate flaky tests automatically.
Caveats & Pitfalls
- ! Interactive
--watchmode blocks until terminated and must not be used in headless runs. - ! Requires a working local
gotoolchain matching the project'sgo.mod.