gotestsum runs tests using go test -json, prints formatted test output, and a summary of the test run. It is designed to work well for both local developments, and for automation like CI. When the --rerun-fails flag is set, gotestsum will re-run any failed tests. The tests will be re-run until each passes once, or the number of attempts exceeds the maximum attempts. Maximum attempts defaults to 2, and can be changed with --rerun-fails=n. gotestsum supports executing a compiled test binary (created with go test -c) by running it as a custom command. pkgname is the name of the package being tested, it will show up in the test output. ./binary.test is the path to the compiled test binary. The -test.v must be included so that go tool test2json receives all the output. When the --watch flag is set, gotestsum will watch directories using file system notifications.

Features

  • Change the test output format, from compact to verbose with color highlighting
  • Print a summary of the test run after running all the tests
  • Use any go test flag, run a script with --raw-command, or run a compiled test binary
  • Write a JUnit XML file for integration with CI systems
  • Write all the test2json input received by gotestsum to a file
  • Print a character for each test

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

Apache License V2.0

Follow gotestsum

gotestsum Web Site

Other Useful Business Software
Full-stack observability with actually useful AI | Grafana Cloud Icon
Full-stack observability with actually useful AI | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of gotestsum!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Frameworks

Registered

2023-02-03