Bug: failure detail lost when test.init name differs from test word name #424
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
rust
technical-debt
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-seq#424
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When a test word calls
test.initwith a descriptive name that differs from the word name itself, theat line N: expected X, got Ydetail produced by #422 is emitted by the runtime but dropped by the test runner — it never reaches theTEST FAILURES:section of the output.Reproducer
Run:
Actual
Note the empty TEST FAILURES section — no
at line N: expected X, got Yline.Expected
Confirmed by changing
"My Descriptive Test"to"test-foo"(matching the word name) — the detail reappears.Root cause (likely)
collect_failure_blockincrates/compiler/src/test_runner.rssearches captured stdout for an exact header match constructed from the discovered word name:But the runtime (
patch_seq_test_finishincrates/runtime/src/test.rs) prints the header using the friendly name passed totest.init:When those differ, the exact-match lookup fails,
collect_failure_blockreturnsNone, and the detail lines that follow on stdout are orphaned.Suggested fixes (pick one)
patch_seq_test_finishprint the word name (the stable identifier the runner discovered) rather than the friendly init name. The friendly name could still appear as a prefix in the TEST FAILURES section for human readability.collect_failure_blockto match any header ending in... FAILED, or to scan by position rather than exact word name. (Slightly more fragile if multiple tests interleave output.)TEST_BEGIN test-foo "My Descriptive Test"on stdout), and match on either.Option 1 is the simplest and matches the rest of the pipeline, which keys on word name.
Impact
test.init), but any Seq test suite that uses descriptive init names will silently lose the new failure-detail benefit of #422.https://github.com/navicore/patch-seq/pull/425