RSpec/Mocha/Vitest-style output for Go that works with plain go test by
reading its raw -v output directly. No TDD framework required. Any suite
using stdlib testing with nested t.Run will work without changes. See
at a glance which spec actually failed, instead of hunting through a wall
of PASS/FAIL lines.
go install github.com/woodie/gorderly@latest
Or build locally:
go build -o gorderly
mv gorderly ~/go/bin/
Pipe go test -v's output straight in:
go test -v ./... | gorderly -fd
Or let gorderly run go test for you:
gorderly -fd .
gorderly -fd ./...
Flags select the output style -- see Output styles below.
gorderly --version
Prints the installed version and exits immediately, without waiting on stdin.
Four named styles, each matching a convention from a familiar test runner.
The first three end with the same xcbeautify-style footer; -fv ends with
Vitest's own footer shape instead.
| Flag | Convention | Look |
|---|---|---|
| Our base formatter | Glyph + name (N seconds), failures add (FAILED - N) |
|
| -fd | RSpec's doc format | Plain colored name, yellow (PENDING) for skips |
| -fs | Mocha's spec format | Green ✔ + gray name, red ✗ name (FAILED - N) |
| -fv | Vitest's own tree | Green ✓ name, two-toned green 2ms, red × name, dim gray ↓ name |
-fv's Test Files line counts one entry per Go package that has test
files, skipping any package go test reports as [no test files] --
Go's own package boundaries give an exact, unambiguous file count, so this
line has no known edge cases.
gorderly only ever needs go test -v's raw output -- it renders
whatever nesting your tests already produce, spec-based or not. For how
we actually write those tests -- spec for structure and lifecycle
hooks, expect for matchers, context
nesting, the subject pattern, mocking and stubbing -- see
docs/FRAMEWORK.md. gorderly's own tests
(parse_test.go, render_test.go, main_test.go, version_test.go,
config_test.go) are real examples of that shape, not just a sketch.
- Tree order follows completion order, which matches declaration order for
serial tests but can reorder under
t.Parallel() - Subtest names have spaces substituted with underscores by
go testitself;gorderlyreverses that for display, which is imprecise for subtest names with genuine underscores in them. - Package build failures are reported by outcome only, not with the
underlying compiler error -- run
go vet/go buildseparately to see why a package failed to build. -fv's per-leaf millisecond timing is only as precise asgo test -v's own output, which reports elapsed time to two decimal places of a second (e.g.0.00s) -- fast subtests will often show a flat0mswhere Vitest's own JS timers would show2ms/4ms. This is a ceiling ingo testitself, not something-fvcan recover.- A literal
/in adescribe/context/itstring is indistinguishable from a nesting boundary once it reachesgo test -v's output --t.Runuses an unescaped/as both the subtest hierarchy separator and the-run/-benchregex-splitting delimiter, and Go's own docs are explicit that a literal/in a subtest name isn't safe. Not somethinggorderly(or any tool parsinggo test's output) can recover after the fact -- see docs/FRAMEWORK.md for the fix on the spec-author side.
make build # go build -o gorderly
make install # builds, then moves the binary to ~/go/bin/
make test # verbose, dogfoods gorderly on its own suite in -fs style
make lint # golangci-lint
make check # terse: silent on success, full log on failure
Cutting a release: bump gorderlyVersion in version.go by hand before
tagging. gorderly's primary install path is go install github.com/woodie/gorderly@latest -- a module-proxy fetch with no .git
metadata to describe -- so the version string has to already be correct in
the committed source at the tagged commit.
