What changed
- Normalizes shard-plan destinations before suite-level test enumeration.
- Resolves platform-only simulator destinations such as
platform=iOS Simulator into concrete simulator destinations with an id.
- Preserves already-concrete destinations that include
id or name.
- Adds regression coverage for suite shard planning with a platform-only iOS simulator destination.
Why
Suite granularity calls xcodebuild test-without-building -enumerate-tests after the build-for-testing phase. The build run succeeded, but enumeration failed because Tuist passed only platform=iOS Simulator, and Xcode could not match that broad destination from .xctestproducts.
Root Cause
The normal build path resolves a concrete simulator destination before invoking Xcode, but shard planning discarded that shape and sent only a platform-level simulator destination into XCTestEnumerator. Xcode accepts enough information to build the test products, but test-without-building -enumerate-tests -testProductsPath needs a concrete simulator destination to enumerate suites reliably.
Impact
Suite-level sharding now enumerates tests using the same kind of concrete simulator destination that the build/test path already resolves, avoiding error 70 for platform-only simulator destinations.
Validation
- Ran
swiftformat on the two touched files.
- Ran
git diff --check successfully.
- Built the committed iOS fixture:
xcodebuild -project examples/xcode/xcode_project_with_tests/App.xcodeproj -scheme App build-for-testing -destination "platform=iOS Simulator,id=99A1ADBF-B5DD-402F-B8DB-BDEBA7220E04" -derivedDataPath /private/tmp/tuist-suite-shard-e2e.ogeIBI/DerivedData -testProductsPath /private/tmp/tuist-suite-shard-e2e.ogeIBI/TestProducts.xctestproducts CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=
- Reproduced the reported failure:
xcodebuild test-without-building -enumerate-tests -testProductsPath /private/tmp/tuist-suite-shard-e2e.ogeIBI/TestProducts.xctestproducts -destination "platform=iOS Simulator"
- Result: exit 70 with
Unable to find a device matching the provided destination specifier: { platform:iOS Simulator }.
- Verified the fixed destination shape:
- Booted simulator
99A1ADBF-B5DD-402F-B8DB-BDEBA7220E04.
xcodebuild test-without-building -enumerate-tests -testProductsPath /private/tmp/tuist-suite-shard-e2e.ogeIBI/TestProducts.xctestproducts -destination "platform=iOS Simulator,id=99A1ADBF-B5DD-402F-B8DB-BDEBA7220E04"
- Result: exit 0 and full suite enumeration:
AppFrameworkTests/AppFrameworkTests/example()
AppTests/AppTests/example()
AppTests/AppTests/parameterized(value:)