Repository navigation
Print the reason a failing boot test gives - #108
Conversation
fail() in the boot tests' base-test.sh printed only its first argument, so the reason about 240 calls pass as the second argument, often the output under test, never reached the CI log. It now prints the reason on the lines after the title, as the boot tests that define their own fail() already do, so the TAP line keeps the bare title. A failure without a reason prints exactly what it did before. fail-reason-test.sh runs the helpers in a child and checks a failure with a reason, one without, and a pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Low impact] This PR appears safe to merge. SummaryUpdates
No actionable issues were found. Tests were inspected but not run during this review. Reviews (1) · Last reviewed commit: "omarchy-mac-boot: print the reason a fai..." · Reviewed by Greptile |
scottjones
left a comment
There was a problem hiding this comment.
Welcome, and thanks for this! It's a really useful change. Printing the reason is format-safe, and a call with no reason prints exactly what it did before. The suite's glob picks up the new test with nothing else to wire in.
|
Note 🤖 Opus 5.5 replying on behalf of Victor. @scottjones, thank you for the welcome and the review. Confirming that a call with no reason prints exactly what it did before was the check that mattered most, since every existing test depends on that output staying the same. |
Problem
fail()inomarchy-mac-boot/test/base-test.shprints only its first argument:About 240 calls in the boot tests that use this helper pass a reason as the second argument, often the output under test (
fail "..." "$(cat "$test_tmp/err")"). The helper drops it, so a boot test that fails in CI shows only its title. A reviewer can't tell a real regression from a host problem without rerunning the test.Change
fail()now prints the reason on the lines after thenot okline:The
not okline keeps the bare title, so a search for a test's title still finds it, and a multi-line reason such as a dumped file stays readable. This is how the boot tests that define their ownfail()(mac-hid-initramfs-test.sh,mac-vconsole-initramfs-test.sh,mac-plymouth-progress-test.sh) already print a reason. A call without a reason prints exactly what it did before.omarchy-mac-boot/test/fail-reason-test.shruns the helpers in a child shell and checks three cases: a failure with a two-line reason prints the title and then the reason, a failure without one prints only its title, and a pass prints only its title.Scope and approval
One change to the boot tests' shared helper and one new test. No package code, manual text or runtime input changes, so there is no version to bump, no integration test and no cold-boot evidence to collect. No issue tracks this; the fix is small enough to review on its own.
Verification
Base
24430b4, candidate404698e.bash omarchy-mac-boot/test/fail-reason-test.shnot ok - a failing test prints its reason after its titleok - a failing test prints the reason it givesomarchy-mac-boot/test/all(Arch-likesh, see below)ok, 2skipmktemppaths differ)shellcheck -xon both files.github/scripts/check-scopeThe same fixture failure on base and on the candidate:
Before (main): the reason is dropped.
After (this branch): the reason follows the title.
Not checked
/bin/shis dash, which orders globs without the locale, soupdate-m1n1-locale-test.shfails on main too. With bash first onPATHassh, as on Arch, the whole suite passes. This change doesn't touch that test.vercmpoff Arch) and the HOOKS takeover case (noOMARCHY_TEST_RUNTIME). CI runs both.Prior PRs
None. No open or closed PR changes this helper. #92 edited
omarchy-mac/test/base-test.sh, a different package's copy, which already prints the reason.Generated with Claude Opus 5.5 and GPT-6.1 Sol in T3 Code Nightly