Skip to content

[Repo Assist] test: add coverage for ARP/MSIX local stubs and detail-cache invalidation#165

Draft
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/test-local-stubs-cache-invalidation-2026-04-28-e9d28c7946a59478
Draft

[Repo Assist] test: add coverage for ARP/MSIX local stubs and detail-cache invalidation#165
github-actions[bot] wants to merge 1 commit intomainfrom
repo-assist/test-local-stubs-cache-invalidation-2026-04-28-e9d28c7946a59478

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

What

Adds 7 targeted unit tests to src/app.rs that cover two previously untested code paths:

load_detail — local stub creation (4 tests)

load_detail has a branch for IDs that cannot be looked up via winget show --exact: ARP registry entries (ARP\...), MSIX/AppX packages (MSIX\...), and packages with no source. For these, it builds a local detail stub and caches it without calling the backend. None of this was tested.

Test Branch covered
load_detail_arp_id_creates_local_stub_without_backend_call ARP prefix → stub, no backend call
load_detail_msix_id_creates_local_stub_without_backend_call MSIX prefix → stub, no backend call
load_detail_empty_source_creates_local_stub_without_backend_call empty source → stub, source = "local"
load_detail_local_stub_is_cached stub is inserted into detail_cache

process_messagesOperationComplete cache invalidation (3 tests)

When an operation (Install / Upgrade / Uninstall / Pin / Unpin) completes, process_messages removes the affected package from detail_cache so the next selection forces a fresh winget show. Only the BatchUpgrade path was previously tested.

Test Branch covered
operation_complete_upgrade_invalidates_detail_cache Upgrade removes entry from cache
operation_complete_pin_invalidates_detail_cache Pin removes entry from cache
operation_complete_failed_single_op_sets_status_and_does_not_refresh failed op sets error status; no post_refresh_status queued

Test Status

cargo check --all-targets  → clean
cargo fmt -- --check       → clean
cargo clippy -- -D warnings → clean
cargo test                 → 238 passed (was 231) — 7 new tests

No production code changed.

Generated by Repo Assist · ● 4.5M ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@cbb46ab386962aa371045839fc9998ee4e97ca64

- load_detail_arp_id_creates_local_stub_without_backend_call
- load_detail_msix_id_creates_local_stub_without_backend_call
- load_detail_empty_source_creates_local_stub_without_backend_call
- load_detail_local_stub_is_cached
- operation_complete_upgrade_invalidates_detail_cache
- operation_complete_pin_invalidates_detail_cache
- operation_complete_failed_single_op_sets_status_and_does_not_refresh

7 new tests; 231 → 238 passing. No production code changed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants