Skip to content

Mock omarchy-osd in the system power test - #8772

Closed
alhasapi wants to merge 1 commit into
omacom:quattrofrom
alhasapi:test-osd-mock
Closed

alhasapi wants to merge 1 commit into
omacom:quattrofrom
alhasapi:test-osd-mock

Conversation

@alhasapi

Copy link
Copy Markdown

The test runs the real bin/omarchy-system-reboot and bin/omarchy-system-shutdown, mocking the commands they call so nothing actually happens. omarchy-osd was left out of that list:

for command in omarchy-state omarchy-hyprland-window-close-all sleep; do

but bin/omarchy-system-shutdown:11 calls it:

omarchy-osd -i shutdown -m "Shutting down" -d 5000

So running the suite paints "Rebooting" and then "Shutting down" across the screen of whoever is running it, five seconds each. I hit this on my own machine and went looking for a scheduled poweroff before I found the test.

Nothing is actually at risk — systemd-run is mocked, so no poweroff is ever scheduled, and omarchy-hyprland-window-close-all is mocked too. But a test that tells you your machine is shutting down is its own kind of failure.

This mocks it like the rest, and asserts the call while here: the icon and message the OSD is asked for are part of what these commands do, and nothing covered them before.

All four assertions pass, and the suite no longer touches the screen.

Copilot AI balanced review requested due to automatic review settings August 28, 2026 15:45

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

Mocks omarchy-osd in system power tests to prevent UI side effects while verifying reboot and shutdown OSD arguments.

Changes:

  • Adds omarchy-osd to mocked commands.
  • Verifies OSD icon, message, and duration.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.


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

The test runs the real bin/omarchy-system-reboot and
bin/omarchy-system-shutdown, mocking the commands they call so nothing
actually happens. omarchy-osd was left out of that list, so running the
suite paints "Rebooting" and then "Shutting down" across the screen of
whoever is running it, five seconds each.

Nothing is at risk — systemd-run is mocked, so no poweroff is ever
scheduled — but a test that tells you your machine is shutting down is its
own kind of failure.

Mock it like the rest, and assert the call while we are here: the icon and
message the OSD is asked for are part of what these commands do.
@bjarneo

bjarneo commented Sep 21, 2026

Copy link
Copy Markdown
Member

Automated duplication check: this pull request looks similar to #7216, which covers the same power test OSD mock. I keep that one open and close this one to consolidate review.

If you feel this is the wrong decision, please open the PR again with a note on the difference.

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.

3 participants