Repository navigation
test(formatter): keep escape sequences out of the go test output - #14351
Merged
Merged
Conversation
Signed-off-by: hiroto.toyoda <hiroto.toyoda@dena.com>
ndeloof
approved these changes
Oct 22, 2026
ndeloof
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Confirmed on a run of go test -v ./cmd/formatter: on main the escape sequences end up right before --- PASS: TestRunHandlesKeysUntilContextIsDone, with this change the output is clean (also with -race).
Nit, not blocking: restoring the previous value of disableAnsi in the cleanup (old := disableAnsi) rather than resetting it to false would be more robust, even if it matches what ansi_test.go does.
ndeloof
enabled auto-merge (rebase)
October 22, 2026 06:59
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Stops
TestRunHandlesKeysUntilContextIsDonefrom being reported as a failure by gotestsum even though it passes.Related issue
No issue: this is a minor test-only fix. Every unit test run currently ends with
=== FAIL: cmd/formatter TestRunHandlesKeysUntilContextIsDone (unknown)andDONE … 1 failure,including green runs on
main. The exit code is 0, but the summary counts one failure,which makes real failures harder to spot (this line was mistaken for a genuine failure in #14339).
Fixes #
Changes made
clearNavigationMenu(). That function writes ANSI escapesequences to
os.Stdoutwithout a trailing newline, so they end up in front of the--- PASSline and gotestsum cannot parse the result.disableAnsi = truefor the duration of the test (restored witht.Cleanup),following the pattern already used in
ansi_test.go. Test-only change; no production code is modified.Testing done
make testmake e2e-composeormake e2e-compose-standalonemake lintmake fmtAI tool used (if applicable)
AI Tool:
Additional context
Introduced by #14324, which added the navigation menu clearing on detach.
(not mandatory) A picture of a cute animal, if possible in relation to what you did
