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

You Might Also Like
Our Free Plans just got better! | Auth0 by Okta Icon
Our Free Plans just got better! | Auth0 by Okta

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
Try free now
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