Skip to content

Stabilize CI test suite after merged show_icon/BaseCore behavior changes#25

Merged
gensyn merged 3 commits into
mainfrom
copilot/fix-failing-test-workflow
May 18, 2026
Merged

Stabilize CI test suite after merged show_icon/BaseCore behavior changes#25
gensyn merged 3 commits into
mainfrom
copilot/fix-failing-test-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

The test workflow started failing after recent merged behavior changes in show_icon and BaseCore. The failures were test/expectation drift (plus UI construction side effects), not production regressions.

  • show_icon test alignment

    • Updated test_icon_action expectations to match new icon-gating behavior (get_icon()-driven sensitivity logic).
    • Mocked GTK Button creation in create_ui_elements/IconWindow init tests to avoid constructing real UI objects during unit tests.
    • Updated IconWindow init assertions for the additional browse button wiring/attachments.
  • BaseCore.on_ready test alignment

    • Patched and asserted migrate_settings(...) in on_ready tests to reflect the new migration call path before settings initialization.
  • Validation path coverage preserved

    • Kept explicit coverage for the “icon selected but empty value” validation branch in IconWindow.on_add_button.
@patch('HomeAssistantPlugin.actions.cores.base_core.base_core.migrate_settings')
def test_on_read_success(self, migrate_settings_mock, ...):
    instance = BaseCore(settings_implementation, track_entity=True)
    instance.on_ready()
    migrate_settings_mock.assert_called_once_with(instance)

@gensyn gensyn marked this pull request as ready for review May 18, 2026 15:58
Copilot AI review requested due to automatic review settings May 18, 2026 15:58
@gensyn gensyn merged commit 5e41234 into main May 18, 2026
2 checks passed
@gensyn gensyn deleted the copilot/fix-failing-test-workflow branch May 18, 2026 15:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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.

Stabilizes the CI test suite after recent behavior changes to show_icon and BaseCore by updating test mocks and expectations to match the new code paths.

Changes:

  • Mock GTK Button construction in IconWindow and ShowIcon tests and update attach count / validation branch expectations.
  • Patch and assert migrate_settings in BaseCore.on_ready tests.
  • Add get_icon/lm mocks for the new set_enabled_disabled icon-gating logic.

Reviewed changes

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

File Description
test/actions/show_icon/test_icon_window.py Mock Button, bump attach count to 15, rework icon validation test for the empty-value branch.
test/actions/show_icon/test_icon_action.py Mock Button and lm in UI creation test; add get_icon and lm mocks for enabled/disabled test.
test/actions/cores/base_core/test_base_core_on_ready.py Patch and assert migrate_settings in all three on_ready tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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