Skip to content

test(smoke): add AT-SPI and state-transition tests for power-status-color extension - #799

Open
mrbobbytables wants to merge 2 commits into
projectbluefin:mainfrom
mrbobbytables:atspi-power-status-color-794
Open

test(smoke): add AT-SPI and state-transition tests for power-status-color extension#799
mrbobbytables wants to merge 2 commits into
projectbluefin:mainfrom
mrbobbytables:atspi-power-status-color-794

Conversation

@mrbobbytables

Copy link
Copy Markdown
Contributor

Summary

Closes #794.

Adds behave/AT-SPI coverage for the power-status-color@projectbluefin.io GNOME Shell extension (projectbluefin/bluefin-bling), which colors the Quick Settings power button based on staged bootc updates / /run/reboot-required and on system uptime.

Note on base branch: the issue asked to base this on a v4 branch, but v4 does not exist in projectbluefin/testsuite (checked via the GitHub API — only main and ~420 other feature/chore branches exist, and main is the repo's default branch). This PR targets main instead.

Note on extension UUID/classes: the issue's draft Gherkin used power-status-color@local and CSS classes bootc-reboot-required / bootc-uptime-overdue. I pulled the actual projectbluefin/bluefin-bling source (extensions/power-status-color/extension.js + stylesheet.css) and the real UUID is power-status-color@projectbluefin.io, and the real style classes are power-status-reboot (yellow) and power-status-overdue (red). Tests use the real names so they'll actually match the shipped extension.

New coverage (tests/smoke/features/power_status_color.feature)

  1. Presence/enablement — extension reports ENABLED, no gnome-shell/extension journal errors, no GJS/St warnings tagged for this extension.
  2. Reboot-required reaction — creating/removing /run/reboot-required on the host is observed by the extension's real Gio.FileMonitor, applying/clearing the power-status-reboot style class on the Quick Settings power button within 5s.
  3. Uptime-overdue precedence — since a real 30-day uptime can't be reproduced in CI, the test stubs only the extension's own _checkUptimeOverdue() probe and drives its real _checkStatus() precedence logic (the reboot-flag path above is exercised with zero stubbing). Confirms power-status-overdue wins over power-status-reboot when both conditions are true, matching extension.js's documented precedence.
  4. Teardown hygiene — after gnome-extensions disable, all custom style classes are gone and the extension's live stateObj is released (evidence there's no dangling closure holding the file monitor/timer). Re-enables the extension afterward so later suite scenarios aren't affected.

Style-class checks go through org.gnome.Shell.Eval (existing pattern in tests/shared/gnome_shell_steps.py) since CSS style classes on St actors aren't exposed via AT-SPI.

Testing

  • ruff check tests/ --select E,F,W --ignore E501 — clean
  • python3 -m pytest tests/unit/ -q — 1546 passed (added 19 new unit tests for the pure helpers in power_status_color_steps.py)
  • PYTHONPATH=. python3 -m behave --dry-run --steps-catalog tests/smoke/features/ — new steps resolve with no ambiguity/collisions vs. the pre-existing catalog
  • python3 scripts/update_coverage_snapshot.py — regenerated docs/skills/test-authoring/suite-map/SKILL.md to include the new suite files

— hive: backend=copilot model=claude-sonnet-5

🐝 Hive Agent: contributor | SHA: 888e7173

mrbobbytables and others added 2 commits September 7, 2026 22:12
…s-color extension

Adds behave coverage for the power-status-color@projectbluefin.io GNOME
Shell extension (projectbluefin/bluefin-bling):

- Extension presence/enablement and journal error/warning hygiene.
- Reaction to /run/reboot-required (yellow 'power-status-reboot' style
  class), applied and cleared via the extension's real file monitor.
- Uptime-overdue alert ('power-status-overdue') precedence over the
  reboot alert, exercised through the extension's own _checkStatus()
  logic with only the uptime probe stubbed (30-day uptime cannot be
  reproduced in CI).
- Lifecycle/teardown hygiene: style classes and the live stateObj are
  gone after gnome-extensions disable.

Style-class assertions go through org.gnome.Shell.Eval since CSS style
classes on St actors are not exposed via AT-SPI.

Closes projectbluefin#794

Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
Stabilize installer unit tests when other tests leave a partial ssh_steps stub in sys.modules, while keeping production probe import explicit.

Assisted-by: Claude Sonnet 5 via GitHub Copilot CLI

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 88.51852% with 31 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...s/smoke/features/steps/power_status_color_steps.py 75.42% 29 Missing ⚠️
tests/unit/test_power_status_color_steps.py 98.62% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Superseded by #808, and currently unmergeable

mergeable_state: dirty. Confirmed with a local test merge onto main:

PR799 CONFLICT

#808 adds the same files under the same paths and closes the same issue (#794):

PR799: tests/smoke/features/power_status_color.feature
       tests/smoke/features/steps/power_status_color_steps.py
       tests/unit/test_power_status_color_steps.py
PR808: (all of the above, plus bluefin_new_extensions / copyous_stress / dakota_extensions)

#808 merges cleanly and passes the whole gate set locally (ruff clean, coverage snapshot fresh, 1645 unit tests). Notably, power_status_color_steps.py in #808 has zero printed-warning soft passes — it is the strongest of the new step modules there.

The conflict is from unrelated files

tests/installer/features/environment.py
tests/unit/test_installer_environment.py

These are a fix for #762, which main already resolved in 54a64e4 (raising=False plus a named regression test at test_installer_environment.py:141). Carrying it here is what makes the branch conflict.

The research in the description is good and worth preserving — the real UUID power-status-color@projectbluefin.io and the real style classes power-status-reboot / power-status-overdue rather than the issue's draft names. If #808's copy of the feature does not reflect that, say so there before it lands. Otherwise recommend closing this in favour of #808.


Generated by Claude Code

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.

[qa] Add AT-SPI and state-transition tests for power-status-color extension

3 participants