Skip to content

feat(testing): Support reusable prepared test artifacts#475

Open
cameroncooke wants to merge 11 commits into
mainfrom
codex/feat/issue-450-build-for-testing
Open

feat(testing): Support reusable prepared test artifacts#475
cameroncooke wants to merge 11 commits into
mainfrom
codex/feat/issue-450-build-for-testing

Conversation

@cameroncooke

Copy link
Copy Markdown
Collaborator

Why

Agents and CI workflows need to prepare tests once and execute them later without falling back to raw xcodebuild. The existing build tools always finished with a normal build action, so they could not expose the reusable products produced by build-for-testing.

What Changed

  • Extend the existing simulator, device, and macOS build tools with buildForTesting and optional testProductsPath inputs.
  • Return managed .xctestproducts bundles and discovered .xctestrun files as structured build artifacts.
  • Let test tools execute either prepared .xctestproducts bundles or advanced .xctestrun inputs without rebuilding, while returning the new .xcresult produced by the run.
  • Move conditional next-step selection into tool manifests so normal builds and prepared-test builds advertise the appropriate follow-up without changing existing output behavior.
  • Add unit, schema, lifecycle, and MCP/CLI snapshot coverage for successful and failing prepared-test workflows.

Fixes #450

Extend existing build and test tools to prepare, return, and consume reusable test artifacts while preserving normal build behavior.

Fixes #450
Move conditional next-step selection into tool manifests and preserve the behavior across MCP, CLI, daemon, and snapshot outputs.

Refs #450
@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/xcodebuildmcp@475

commit: ae6d5ba

@cameroncooke
cameroncooke marked this pull request as ready for review July 16, 2026 16:19
Comment thread src/snapshot-tests/__fixtures__/cli/text/macos/test--failure.txt
Comment thread src/utils/test-common.ts
Keep source-only xcodebuild arguments out of the generated test-without-building phase and sort final test failures independently of emission order.
Comment thread src/mcp/tools/device/build_device.ts
Comment thread src/mcp/tools/device/build_device.ts
Comment thread src/utils/test-common.ts Outdated
Comment thread src/utils/test-common.ts
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.
Comment thread src/snapshot-tests/preflight/simulator.ts Fixed
Comment thread src/utils/test-source.ts
Comment thread src/utils/test-common.ts
Comment thread src/snapshot-tests/__fixtures__/cli/json/swift-package/run--success.json Outdated
Comment thread src/snapshot-tests/__fixtures__/cli/text/macos/stop--success.txt
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.
Comment thread src/utils/test-source.ts
Comment thread src/mcp/tools/macos/build_macos.ts
Keep only-testing and skip-testing arguments in the prepared test phase while retaining session-default conflict filtering.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ae6d5ba. Configure here.

platform,
logPrefix: `${platform} Device Build`,
logPrefix: `${platform} Device ${resolved.logLabel}`,
deviceId: params.buildForTesting ? params.deviceId : undefined,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session device blocks generic builds

Medium Severity

Adding deviceId to the build_device schema makes session deviceId merge into every buildForTesting call. A session device then forces a device-specific destination, so the supported generic build-for-testing path becomes unreachable without clearing session defaults, and portable products can be built for the wrong device.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ae6d5ba. Configure here.

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.

Add explicit build-for-testing action

1 participant