Skip to content

feat: better testing UX and some impros - #4

Merged
romancitodev merged 4 commits into
mainfrom
feat/retry-failed-test
Sep 11, 2026
Merged

romancitodev merged 4 commits into
mainfrom
feat/retry-failed-test

Conversation

@romancitodev

Copy link
Copy Markdown
Owner

No description provided.

norimel clips text runs at the buffer edge rather than wrapping them, so a
single long Debug line in a failed test's captured stdout got cut mid-token.
Hard-wrap each line to the terminal width (minus a right-hand padding
margin) before handing it to the existing scroll/pagination logic.
…! diffs

The failed-test stdout panel gave every line the same visual weight, so the
one line that matters (the panic message) got lost in whatever the test
printed before it. Tag the message line bold and, when libtest's own
"  left: "/" right: " pair follows it, color left red and right green, so
the eye lands on the failure instead of scanning a wall of uniform text.
Verified against real cargo test --format json output for an assert_eq!
failure, not just synthetic strings.
stdout_scroll only got clamped at render time for display, so it kept
counting past the true max while held at the bottom, and Up needed the
same number of presses to unwind that overshoot before the view actually
moved. Write the clamped value back to state instead of just reading a
clamped local.

Also add Char('q') next to every existing Esc quit/dismiss arm, and
mention it in the two hint lines.
Fixing a failing test used to mean rerunning the whole suite to check it.
`r` on the selected row now rebuilds quietly (no live progress, so the
build/progress block above the accordion doesn't reanimate) and reruns just
that test with --exact, trying each binary in turn since a rebuilt binary's
hash-suffixed filename can change.

While it runs the row shows a yellow triangle instead of its marker/time.
On pass it drops out of the list and selection moves on; on failure it
updates in place with the fresh location/stdout, still expanded.

build() now takes tx as Option<&Emitter<Event>> so the quiet rebuild can
reuse it without sending progress events, and returns the compiler's error
text so a failed retry rebuild has something to show instead of nothing.

Verified against a real two-binary scratch crate: a binary with no matching
--exact test emits zero `test` events (confirming the try-next-binary logic)
and the one that does have it reports the real failure.
@romancitodev
romancitodev merged commit c354415 into main Sep 11, 2026
2 checks passed
@romancitodev
romancitodev deleted the feat/retry-failed-test branch September 11, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant