Skip to content

Stub OSD calls in power tests - #7216

Open
DatAIrchitect wants to merge 2 commits into
omacom:quattrofrom
DatAIrchitect:fix-system-power-test-osd-stub
Open

DatAIrchitect wants to merge 2 commits into
omacom:quattrofrom
DatAIrchitect:fix-system-power-test-osd-stub

Conversation

@DatAIrchitect

Copy link
Copy Markdown

Summary

  • stub omarchy-osd in the system power test so it cannot reach the active desktop
  • assert the exact reboot and shutdown OSD calls in their production order

Why

The power test runs the real reboot and shutdown scripts behind command stubs. Because omarchy-osd was not stubbed, those scripts could reach the active Omarchy shell and display real OSD messages during a test run.

Testing

  • bash test/shell.d/system-power-test.sh in disposable Arch and native Linux gates
  • negative control: removing the reboot OSD call fails on the new expected log line
  • ./test/all in the disposable native Linux gate — all 180 test files passed
  • Bash 5 syntax check and git diff --check

This is a test-only change, so visual verification and graphical acceptance are not applicable.

Fixes #6999

@DatAIrchitect
DatAIrchitect marked this pull request as ready for review August 18, 2026 20:25
Copilot AI balanced review requested due to automatic review settings August 18, 2026 20:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the system power shell test to assert that a user-facing OSD notification is invoked when scheduling reboot/shutdown actions.

Changes:

  • Adds omarchy-osd to the mocked command set in the test harness.
  • Extends assert_power_calls expectations to include an omarchy-osd invocation with an action-specific message.
  • Updates reboot/shutdown assertions to pass the expected OSD message text.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/shell.d/system-power-test.sh Resolved
Comment thread test/shell.d/system-power-test.sh Resolved
Copilot AI review requested due to automatic review settings August 19, 2026 18:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Sep 28, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at ebaf5447 against current quattro (3faafba2), and nothing needs changing.

I ran it on a disposable Omarchy worker with a live desktop, with a logging omarchy-osd placed behind the test's mocks so any call that escaped them would show up. On quattro the test passes but reaches the real omarchy-osd twice (-i reboot -m Rebooting -d 5000 and -i shutdown -m Shutting down -d 5000), which is the OSD #6999 describes. On this branch it never reaches it and passes 4/4. With omarchy-osd taken back out of the stub list, the new assertion fails on the missing OSD line, so the test now guards the fix. ./test/cli and the full ./test/shell suite (2222 passed, 0 failed) are green on the same worker.

omarchy-system-reboot and omarchy-system-shutdown are unchanged on quattro since this branch was cut, so the expected log still matches. The tab-separated mock logging follows channel-test.sh and is what lets the test tell "Shutting down" as one argument from two, and the zero-argument omarchy-hyprland-window-close-all line no longer carries a trailing space.

Reviewed by Claude Opus 5.5 and, as a second opinion, Codex Medium, which read the diff and the scripts under test and found nothing wrong; it agreed with this reading, and its independence is not guaranteed. #8772 made the same change and was closed in favour of this one. This waits on the maintainer.

@omarchybot omarchybot added ready Good to merge and removed ready Good to merge labels Sep 28, 2026
@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 4, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This now conflicts with quattro because quattro fixed #6999 another way in the meantime, so I'd recommend closing it rather than porting it.

#13076 (merged 2026-10-04, commit 92f9864, "Prevent lid closure from interrupting shutdown") rewrote test/shell.d/system-power-test.sh around the new inhibited shutdown service, and its mock list now includes omarchy-osd. Checked against quattro at b6f2c1ce: the mocks are first on PATH for the whole test, and every place it runs omarchy-system-reboot or omarchy-system-shutdown inherits them. That covers the normal runs, the --inhibit/--inhibited worker run through the mocked systemd-inhibit, the stale-checkout and blocked-window cases, and the failure cases. Reboot's exact omarchy-osd -i reboot -m Rebooting -d 5000 call is asserted in order, and the shutdown OSD call is asserted to come after inhibition. Nothing in the test can reach the real OSD any more.

Your branch still adds one thing quattro lacks: logging the mock arguments tab-separated, so the test can tell "Shutting down" as one argument from two and can assert the shutdown OSD call exactly. That is a stronger test rather than a fix, and the old shutdown expectations here would have to be rewritten for the service-based flow before it could apply. If you'd like it kept, a fresh PR against quattro that only adds it would be the cleanest way.

I checked this by reading the diff, the current test, and the history of the scripts and test on quattro. Nothing was run, since there is no fix left to verify. Reviewed by Claude Opus 5.5 and, as a second opinion, Codex Medium, which went through every place the test calls the scripts on quattro and reached the same conclusion: close as already fixed. It agreed with this reading, and its independence is not guaranteed. Closing it is the maintainer's call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

system-power-test.sh invokes the real Omarchy OSD

3 participants