A command line tool for analyzing and summarizing
go test output.
Don't forget to run
go test with the
tparse will always return test failures and panics, if any, followed by a package-level summary table.
To get additional info on passed tests run
-pass flag. Tests are grouped by package and sorted by elapsed time in descending order (longest to shortest).
go get github.com/mfridman/tparse
Or download the latest pre-built binary here.
tparse is installed there are 2 ways to use it:
go testas normal, but add
-jsonflag and pipe output to
go test fmt -json | tparse -all
-jsonflag into a file and call
tparsewith filename as an argument.
go test fmt -json > fmt.out tparse -all fmt.out
tparse -h to get usage and options.
go test is awesome, but a bit verbose. Sometimes one just wants failures, grouped by package, printed with a dash of color and bubbled to the top.
tparse attempts to do just that; return failed tests and panics, if any, followed by a single package-level summary.
But, let's take it a bit further. With
-skip combined) can get additional info, such as which tests were skipped and elapsed time of each passed test.
tparse comes with a
-dump flag to replay everything that would have otherwise been printed. Enabling users to retrieve original
go test output. Eliminating the need for
tee /dev/tty between pipes.
The default print order is:
go testoutput (if adding
The default print order can be reversed with
For narrow displays the
-smallscreen flag may be useful, dividing a long test name and making it vertical heavy:
TestSubtests/an_awesome_but_long/subtest_for_the/win TestSubtests /an_awesome_but_long /subtest_for_the /win
tparse aims to be a simply alternative to one-liner bash functions.
tparse uses itself in GitHub actions: