DEV.co
Open-Source Testing · gotestyourself

gotestsum

gotestsum is a Go test runner that wraps `go test` to provide human-friendly output formats, JUnit XML export for CI integration, and test summaries. It supports local development workflows (watch mode, flaky test re-runs) and enterprise CI/CD pipelines with customizable output and post-run commands.

Source: GitHub — github.com/gotestyourself/gotestsum
2.7k
GitHub stars
169
Forks
Go
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorygotestyourself/gotestsum
Ownergotestyourself
Primary languageGo
LicenseApache-2.0 — OSI-approved
Stars2.7k
Forks169
Open issues114
Latest releasev1.13.0 (2025-09-11)
Last updated2026-04-15
Sourcehttps://github.com/gotestyourself/gotestsum

What gotestsum is

gotestsum parses `go test -json` output to render multiple output formats (dots, pkgname, testname, testdox, standard), generates JUnit XML for CI systems, writes line-delimited JSON for analysis, and offers features like re-run-fails, watch mode, and post-run command hooks. It is a pure Go CLI tool with no external runtime dependencies.

Quickstart

Get the gotestsum source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/gotestyourself/gotestsum.gitcd gotestsum# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

CI/CD Pipeline Integration

Export test results as JUnit XML for integration with Jenkins, GitLab CI, GitHub Actions, and other CI systems. Customize testsuite names and classnames to align with your pipeline's expectations.

Local Development Workflow

Use watch mode to automatically re-run tests when Go files change, and post-run commands for desktop notifications. Identify and skip slow tests with the `gotestsum tool slowest` subcommand.

Flaky Test Management

Re-run failed tests automatically with configurable max attempts and failure thresholds. Store full JSON output for offline analysis and trend detection across test runs.

Implementation considerations

  • Install via `go install gotest.tools/gotestsum@latest` or download precompiled binaries from releases; no system-level dependency management required.
  • Familiarize your team with output format options (`--format` flag) and CI integration patterns; documentation covers most common use cases.
  • When using `--rerun-fails`, set `--rerun-fails-max-failures` to prevent excessive re-runs on widespread test failures.
  • For `--post-run-command`, test the command in isolation and ensure all required tools are available in the execution environment.
  • Store `--jsonfile` output if you plan offline analysis, trend tracking, or feeding results into downstream tools like test analytics.

When to avoid it — and what to weigh

  • Non-Go Projects — gotestsum is explicitly designed for Go. Use language-specific test runners or generic CI test harnesses for other ecosystems.
  • Custom Test Frameworks Outside Go Ecosystem — If your tests do not emit `go test -json` compatible output, you cannot use gotestsum directly. Consider `--raw-command` only if you can adapt output.
  • Real-Time Test Streaming to Remote Systems — gotestsum is a local CLI tool. For streaming test results to remote dashboards or services, you will need to pipe JUnit/JSON output to another tool.
  • Minimalist Go Workflows — If you are satisfied with vanilla `go test` output and do not use CI/CD, the overhead of learning gotestsum's flags and format options may not justify adoption.

License & commercial use

Licensed under Apache License 2.0 (Apache-2.0), a permissive OSI-approved open-source license.

Apache-2.0 permits commercial use, modification, and distribution provided that copyright notices and license text are included. No commercial restrictions apply. However, verify your legal and compliance teams' interpretation for your specific use case.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

gotestsum is a CLI tool that executes `go test` and optionally runs user-specified post-run commands via `--post-run-command`. No authentication, network, or credential handling documented. Ensure post-run commands are validated to prevent injection attacks. Supply chain: review GitHub repository and release signatures if sourcing pre-built binaries.

Alternatives to consider

go test (native)

Vanilla Go test runner; no formatting overhead, but lacks summary, JUnit export, watch mode, and flaky test re-run features.

pytest (Python) / Jest (Node.js)

Language-specific test runners with similar feature sets (formatting, CI export, watch mode) but designed for non-Go ecosystems.

TestNG / JUnit (Java)

Enterprise test frameworks with rich reporting; suitable for Java/JVM projects but incompatible with Go's testing model.

Software development agency

Build on gotestsum with DEV.co software developers

Integrate gotestsum into your Go CI/CD pipeline or local workflow. Explore installation, examples, and advanced features in the official repository.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

gotestsum FAQ

Can gotestsum run in CI without installing Go?
Yes, via precompiled binaries. Set `GOVERSION` environment variable to suppress Go version warnings if Go is not installed.
Does gotestsum change how tests are executed?
No. gotestsum is a wrapper that parses `go test -json` output; it does not modify test execution, only output formatting and reporting.
Can I use gotestsum with non-standard test frameworks (e.g., ginkgo, testify)?
Partially. If the framework integrates with `go test`, gotestsum will work. Use `--raw-command` for custom test binaries; output must be compatible with `test2json` format.
What happens if gotestsum fails or crashes?
gotestsum itself is robust (actively maintained, high adoption), but errors typically stem from Go binary unavailability, malformed flags, or post-run command failures. Check logs and verify CLI arguments.

Software developers & web developers for hire

From first prototype to production, DEV.co delivers software development services around tools like gotestsum. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across open-source testing and beyond.

Ready to Streamline Go Testing?

Integrate gotestsum into your Go CI/CD pipeline or local workflow. Explore installation, examples, and advanced features in the official repository.