[#121] Add DoctorRunner integration test harness#258
Merged
Conversation
This was referenced Mar 21, 2026
502603f to
cd19612
Compare
d2bd9dc to
cf04342
Compare
cd19612 to
be4bbe6
Compare
39bbae3 to
0fd9d16
Compare
- Add `environment` property to DoctorRunner and 10 check structs (CommandCheck, MCPServerCheck, PluginCheck, HookCheck, GitignoreCheck, ProjectIndexCheck, PackGitignoreCheck, ExternalCommandExistsCheck, ExternalHookEventExistsCheck, ExternalSettingsKeyEqualsCheck), replacing all hardcoded `Environment()` calls - Add `projectRootOverride` to DoctorRunner to bypass ProjectDetector.findProjectRoot() in tests - Flow environment through DerivedDoctorChecks and standaloneDoctorChecks
- Thread environment from DoctorCommand to DoctorRunner - Pass environment to PackGitignoreCheck in artifactChecks() - Remove redundant environment parameter from private standaloneDoctorChecks()
- Add `environment` property to DoctorRunner and 10 check structs (CommandCheck, MCPServerCheck, PluginCheck, HookCheck, GitignoreCheck, ProjectIndexCheck, PackGitignoreCheck, ExternalCommandExistsCheck, ExternalHookEventExistsCheck, ExternalSettingsKeyEqualsCheck), replacing all hardcoded `Environment()` calls - Add `projectRootOverride` to DoctorRunner to bypass ProjectDetector.findProjectRoot() in tests - Flow environment through DerivedDoctorChecks and standaloneDoctorChecks
- Thread environment from DoctorCommand to DoctorRunner - Pass environment to PackGitignoreCheck in artifactChecks() - Remove redundant environment parameter from private standaloneDoctorChecks()
- Add 6 tests exercising DoctorRunner.run() end-to-end in sandbox - Test empty registry, globalOnly, pack filter, missing artifacts, excluded components, and project state resolution - All tests use Environment(home: tmpDir) + projectRootOverride
0fd9d16 to
43538aa
Compare
- Add shared makeSandboxProject(label:) to TestHelpers.swift, built on top of makeGlobalTmpDir - Remove duplicated private helper from DoctorRunnerIntegrationTests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a test harness that exercises
DoctorRunner.run()end-to-end in a fully sandboxed environment. This verifies the runner correctly resolves scopes, loads project state, filters by pack, and handles excluded components — all without touching real~/paths.Stacked on #257 (PR 2 of the #121 series).
Changes
DoctorRunnerIntegrationTests.swiftwith 6 tests:globalOnlyflag restricts to global scopepackFilterrestricts to specified packs.mcs-projectstateTest plan
swift testpasses locally (764 tests, 0 failures)swiftformat --lint .andswiftlintpass without violationsmcs sync,mcs doctor)