-
Notifications
You must be signed in to change notification settings - Fork 13
filter(go): add go test filter #42
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Goal
Expand Go filters to cover go test -v — the verbose test output mode widely used in CI and agent contexts. Currently go/build.toml and go/vet.toml exist but test output has no filter.
Background
go test -v ./... on a large repo emits:
=== RUN TestFunctionNamefor every test--- PASS: TestFunctionName (0.00s)for every passing test- All
t.Log()/t.Logf()output captured during passing tests ok package/path 0.123sfor every passing package
The Go team has an open proposal (golang/go#59201) for a -vf (verbose-when-fail) flag that would only show details for failing tests — a feature the community has wanted for years. gotestsum exists as a community workaround.
Filters to Add
go/test.toml — go test -v / go test -v ./...
- Skip:
=== RUN ...lines for passing tests,--- PASS: ...lines,t.Logoutput lines for passing tests,ok packagesummary lines when all pass - Keep:
--- FAIL: ...lines=== RUNheader for the failing test- All output lines between a failing
=== RUNand its--- FAIL(error details, stack traces) FAIL\tpackage/pathlinespanic:lines- The final
FAILoroksummary
Consider section parsing: track === RUN as section open, --- PASS as discard-section, --- FAIL as keep-section.
go/test-race.toml — go test -race
- Same as
go/test.tomlbut also keep data race detector output (WARNING: DATA RACEblocks)
Fixture Files Needed
tests/fixtures/go/test-all-pass.txt— verbose output with 50+ passing teststests/fixtures/go/test-failure.txt— mixed passing and failing tests, failures with assertion detailstests/fixtures/go/test-panic.txt— test that panics mid-execution
Acceptance Criteria
-
--- PASSand=== RUNlines for passing tests removed - Failed test
=== RUN/--- FAILlines and their captured output preserved -
panic:output always preserved - Integration tests pass for all fixture files
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request