Skip to content

joaopsramos/gotestpp

Repository files navigation

gotestpp

gotestpp (gotest++) runs tests using go test -json, prints formatted test output similar to the original and a summary at the end. Its main purpose is to make test failures easier to understand. It also parses Testify assertions, adding colors and slightly modifying the output format.

Features

  • Colored output
  • Support for testify assertions
  • Logs are printed only if they originate from failed tests
  • Summary

Print order:

  • Passed packages
  • Skipped tests
  • Failed tests
  • Errors (build errors or when gotestpp fails to run)
  • Summary

Installation

go install github.com/joaopsramos/gotestpp@latest

Usage

Simply use gotestpp instead of go test:

gotestpp ./...

Note

Even though all flags that work with go test are accepted by gotestpp, some outputs may not appear due to the way Go provides test events.

You can also pipe the output to gotestpp:

go test ./... -json | gotestpp

Important

If piping go test output, the -json flag must be included.

Output Example

Success:

Test failed + build failed:

Why another tool for this?

There are incredible tools that do something similar, but I wanted one that makes failures easier to understand, especially by improving (in my opinion, of course) the output of Testify assertions.

About

Better test output for Go

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages