-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or requesttest-gapMissing test coverageMissing test coverage
Description
Problem
Issue #121 added end-to-end lifecycle integration tests covering 9 scenarios, but no test exercises two projects sharing global packs with different per-project configurations. This is the last untested cross-component interaction path identified in #121.
What's missing
When two projects share global packs (brew packages, plugins, MCP servers with user scope), the reference counting system (ResourceRefCounter + ProjectIndex) must ensure:
- Global resources are not removed when one project deselects a pack but another still uses it
mcs pack removecorrectly discovers all affected scopes and unconfigures eachProjectIndexaccurately tracks which projects use which packs
No existing test exercises this multi-scope interaction end-to-end.
Proposed Solution
Add a multi-project integration test scenario:
Scenario: Two projects sharing a global pack
- Create two temp projects (A and B) under the same sandbox home
- Create a pack with a brew package, MCP server, and template
- Configure project A with the pack → verify artifacts installed, project index updated
- Configure project B with the same pack → verify project index has both entries
- Remove the pack from project A → verify:
- Global resources (brew, plugins) are NOT removed (project B still uses them)
- Project A's local artifacts (template sections, settings, hooks) ARE removed
- Project index still has project B's entry
- Remove the pack from project B → verify:
- Global resources are now removed (ref count = 0)
- Project index has no entries for this pack
Implementation notes
- Builds on the
LifecycleTestBedinfrastructure from Add end-to-end integration tests for full pack lifecycle #121 - Needs two
Configuratorinstances (one per project) sharing the sameEnvironment(home:)andMockClaudeCLI ResourceRefCounterreadsProjectIndexto decide whether to remove shared resources — this is the critical cross-project interaction to verify- Keep tests hermetic: sandbox home, no real
~/paths
References
- PR [#121] Make DoctorRunner and checks accept injectable Environment #256, [#121] Add sandbox tests for core doctor checks #257, [#121] Add DoctorRunner integration test harness #258, [#121] Add end-to-end lifecycle integration tests #259 — Add end-to-end integration tests for full pack lifecycle #121 implementation (stacked PRs)
Sources/mcs/Install/ResourceRefCounter.swift— two-tier reference countingSources/mcs/Core/ProjectIndex.swift— cross-project pack trackingTests/MCSTests/LifecycleIntegrationTests.swift— existing lifecycle test infrastructure
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesttest-gapMissing test coverageMissing test coverage