opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

Stop scrolling through go test output—let tparse summarize failures, panics, and...
GitHub RepoImpressions2

Project Description

View on GitHub

Stop Scrolling Through go test Output—Let tparse Summarize What Actually Matters

You know the drill. You run go test ./..., and suddenly your terminal is a wall of text. Somewhere in that noise are the failures you actually care about, but good luck finding them without a manual search for --- FAIL. That's where tparse comes in—a command-line tool that takes the verbose JSON output from go test and turns it into something you can actually read at a glance.

What It Does

tparse is a small Go utility that analyzes and summarizes go test output. The key requirement is that you run your tests with the -json flag, which makes Go emit structured data instead of plain text. tparse then consumes that stream and reformats it into a clean, organized view.

By default, tparse shows you the things you can't afford to miss: failed tests and panics, followed by a package-level summary table. If you want the full picture, you can pass the -pass flag to see which tests succeeded, grouped by package and sorted by elapsed time (longest to shortest). There's also a -all flag that combines passed and skipped test info, and a -skip flag if you only care about the ones that got skipped.

The tool works in two ways. You can pipe output directly: go test fmt -json | tparse -all. Or you can save the output to a file first and point tparse at it later with the -file option. Both approaches are equally supported, which makes it easy to integrate into scripts or CI pipelines.

Why It's Cool

What makes tparse genuinely useful is that it solves a problem every Go developer hits, without trying to be something it isn't. Here's what stands out:

  • It eliminates the "search for FAIL" ritual. The whole pitch is in the README's question: "But why?!" Because go test is awesome but verbose, and you shouldn't have to grep through hundreds of lines to find what broke. tparse surfaces failures and panics immediately, grouped by package, with color.

  • The -follow flag is a clever touch. When you pipe JSON output, you often lose the familiar human-readable test progress. tparse's -follow flag parses the JSON and prints it back out as if you'd run go test without -json. That means you don't need to hack together tee /dev/tty between pipes to see what's happening in real time. It's a small convenience, but it makes the tool feel complete.

  • It respects your terminal width. The -smallscreen flag is designed for narrow displays. Instead of cramming a long subtest name into one line, it breaks it vertically:

TestSubtests
 /an_awesome_but_long
 /subtest_for_the
 /win

That's thoughtful design for anyone who's ever squinted at a truncated test name on a laptop screen.

  • It's a simple alternative to bash one-liners. The README explicitly frames tparse this way. You could write a shell function to parse go test output, but you'd be reinventing a wheel that's already been polished. tparse is opinionated about what output matters and in what order: followed output (if requested), passed/skipped tables, then failures and panics, then the summary.

How to Try It

Getting started is straightforward. Install it with Go:

go install github.com/mfridman/tparse@latest

Or grab a pre-built binary from the releases page.

Then run your tests with the -json flag and pipe the output. Here's the direct approach:

set -o pipefail && go test fmt -json | tparse -all

The set -o pipefail is worth noting—it ensures the exit code from go test isn't masked by the pipe to tparse, which matters in CI.

If you prefer saving output to a file, that works too:

go test fmt -json > fmt.out
tparse -all -file=fmt.out

You can also run tparse -h to see all available options. The README mentions flags like -pass, -skip, -all, -follow, and -smallscreen, so there's room to tailor the output to your workflow.

One important tip from the README: don't forget the -json flag on go test. Without it, tparse has nothing to parse.

Final Thoughts

If you write Go code regularly, tparse is one of those tools you'll wonder how you lived without—not because it's flashy, but because it removes a recurring annoyance. It's best suited for developers who want concise, actionable test output without adopting a heavyweight testing framework or writing custom parsing scripts. The tool is honest about its scope: it's a simple alternative to bash one-liners, not a full test dashboard. That restraint is a feature. Give it a try on your next failing test run, and you might find yourself reaching for it even when everything passes.

Follow @githubprojects for more developer tools and open source projects.

Back to Projects
Project ID: 55e64eba-9df2-41cc-be7f-963a345c40b5Last updated: September 7, 2026 at 04:55 AM