Repository navigation
Stub omarchy-osd in the system power test - #12575
davidboulay wants to merge 1 commit into
Conversation
The test runs bin/omarchy-system-reboot and bin/omarchy-system-shutdown for real, stubbing systemd-run, omarchy-state, omarchy-hyprland-window-close-all and sleep. omarchy-osd was left out, so both scripts' `omarchy-osd -i ... -d 5000` calls ran unstubbed. omarchy-osd is a wrapper around `omarchy-shell -q osd show`, which reaches the shell over IPC keyed on HYPRLAND_INSTANCE_SIGNATURE and XDG_RUNTIME_DIR. Neither the stub PATH nor a sandboxed HOME isolates that, so running the suite on a live session painted "Rebooting" and then "Shutting down" on the real screen for five seconds each — with no reboot or shutdown behind them, since systemd-run was mocked. Stub it alongside the rest and assert the call, so the OSD each script shows is covered rather than merely escaping. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Verified: the power test keeps OSD calls inside its mocksVerified: The baseline's passing test still sent Verified: the new stub records the expected icon, message, duration and ordering. Diagnostic mutations removing the OSD, changing its message/icon, moving its position, or invoking it after failed scheduling are rejected by the patched assertions. The test also works without an installed OSD helper. Review informationTest scope: isolated command/IPC boundaries and an owned graphical session, with destructive operations intercepted. Only test code changes; no production power behavior change is claimed. Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review. Automated AI review: Astra ran initial tests and mutation controls; independent Fable 5.1 and Astra reviewers added wrapper, failure-path and graphical validation. Both completed reports and material evidence were read before synthesis. |
|
Thanks for tracking this down, @davidboulay. Your diagnosis is right: on current This duplicates #7216, which is older, targets I compared the two diffs against I'm closing this in favour of #7216. If I've misread the two, reopen it. |
test/shell.d/system-power-test.shrunsbin/omarchy-system-rebootandbin/omarchy-system-shutdownfor real. It stubssystemd-run,omarchy-state,omarchy-hyprland-window-close-allandsleep— but notomarchy-osd, so line 11 of each script runs unstubbed:omarchy-osd -i shutdown -m "Shutting down" -d 5000omarchy-osdis a thin wrapper aroundomarchy-shell -q osd show, which reaches the shell over IPC keyed onHYPRLAND_INSTANCE_SIGNATURE/XDG_RUNTIME_DIR. Neither the stub PATH nor a sandboxedHOMEisolates that. Running the suite on a live session paints "Rebooting", then "Shutting down", centred at the bottom of the real screen for five seconds each — with nothing behind them, becausesystemd-runis mocked. It reads exactly like the machine is going down.Found it the confusing way: an OSD appeared mid-session on an otherwise healthy machine. Uptime was unbroken,
/run/systemd/shutdown/scheduledwas empty, no transientrun-r*timer existed and every window was still open — because the only real call in that script was the OSD.Headless CI never noticed: with no compositor
omarchy-osdjust fails, and the script doesn't check its exit status.This stubs it alongside the rest and asserts the call rather than letting it escape, so the OSD each script shows is now covered.
toggle-input-device-test.sh,chromium-ytdlp-test.shandbrightness-display-apple-cache-test.shalready stubomarchy-osd, so this brings the last executor in line — I checked the other nineomarchy-osdcallers underbin/and no other test actually executes one.Verified on a live Hyprland session: all four assertions pass, nothing is painted on screen.
🤖 Generated with Claude Code