Commit 398bcee
authored
Fix phantom test failures from tool first-run spinners writing to os.Stdout (#9028)
The tool first-run middleware creates detect/install spinners via
uxlib.NewSpinner without setting Writer, so they default to os.Stdout and
emit cursor escape codes (\033[?25l / \033[?25h) during unit tests. Under
'go test -json' these raw bytes corrupt the event stream, causing phantom
'unknown'/FAIL results on this and adjacent middleware tests.
Route both spinners through m.console.Handles().Stdout, matching the prompts
in the same file. Under MockConsole this handle is io.Discard (no leakage in
tests); in production it is the real stdout, so behavior is unchanged.1 parent 1071d70 commit 398bcee
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| |||
416 | 417 | | |
417 | 418 | | |
418 | 419 | | |
| 420 | + | |
419 | 421 | | |
420 | 422 | | |
421 | 423 | | |
| |||
0 commit comments