feat(testing): Support reusable prepared test artifacts#475
Merged
Conversation
commit: |
cameroncooke
marked this pull request as ready for review
July 16, 2026 16:19
Keep source-only xcodebuild arguments out of the generated test-without-building phase and sort final test failures independently of emission order.
Share per-test environment setup and cleanup across snapshot suites, cache suite-level simulator builds, and normalize volatile output so fixtures remain stable. Update non-environmental fixtures and add coverage for cleanup and normalization behavior.
Prevent session defaults and selectors from leaking into prepared test runs, remove a useless simulator state initializer, and align volatile snapshot fixtures across CLI and MCP.
Keep only-testing and skip-testing arguments in the prepared test phase while retaining session-default conflict filtering.
Retry app cleanup after a concurrent simulator shutdown and tolerate a boot that completes between the state check and boot command.
Update the discovery schema expectation and keep device and macOS fixtures aligned with the generated artifacts.
Treat an already-shut-down simulator as successful cleanup and align compiler-failure fixtures with the emitted result shape.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 94d4ae3. Configure here.
Jason-Abbott
added a commit
to toba/xc-mcp
that referenced
this pull request
Jul 20, 2026
…uild test-without-building test_macos, test_sim, and test_device gain a without_building flag that runs 'xcodebuild test-without-building' to reuse the test bundle a prior run compiled into the project's scoped DerivedData, skipping the build/planning phase on repeated runs. XcodebuildRunner.test gains a withoutBuilding flag — the test-arg assembly is extracted into a testable static testArgs — that preserves the -destination and -only-testing/-skip-testing/-testPlan selectors into the without-building phase and records the actual action in RawBuildLog. A shared withoutBuildingSchemaProperty is merged into all three tools and threaded through TestToolHelper.runAndFormat. swift_package_test is left unchanged since SwiftPM's 'swift test' has no build/test split. The scoped DerivedData is the stable artifact reference, so no session/key machinery was needed. Inspired by getsentry/XcodeBuildMCP#475.
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
This adds a build-once, test-later workflow to XcodeBuildMCP. A caller can prepare test products, keep the resulting artifacts, and run those tests later without compiling again.
What changes for users
buildForTesting..xctestrunfiles..xctestrunfile without rebuilding.Supporting work in this PR
The PR also makes snapshot tests set up and clean up their own simulator, device, and macOS app state through shared preflight helpers. It does not delete simulators or alter machine-wide Xcode configuration. The helpers now tolerate a simulator boot or shutdown that races with test cleanup.
Verification
Fixes #450