ci: run StoreKit tests on Mac Catalyst with Xcode 26#6897
Draft
ajpallares wants to merge 14 commits into
Draft
Conversation
Adds a Mac Catalyst test job that runs the full iOS test plan (including StoreKit tests) on the Mac Catalyst variant with Xcode 26.5, to check whether the StoreKit product-fetching bug that breaks iOS simulator tests on Xcode 26.4+ also reproduces on Mac Catalyst. Wires the job into the run-all-tests and release workflows and adds it to the all-tasks-passed / all-tests-succeeded merge gates. Co-authored-by: Cursor <cursoragent@cursor.com>
The StoreKitTest framework's Swift overlay (setSimulatedError(_:forAPI:) and FailableStoreKitAPI) ships no Mac Catalyst (macabi) slice in Xcode 26.5, so tests using it fail to compile for Catalyst. Guard those tests out / skip them on Catalyst. testPurchaseFailureClearsPresentedPaywall is kept defined (skipped at runtime) to satisfy PurchasesOrchestratorTests. Also fix MockPurchases.presentCodeRedemptionSheet(), which implemented a requirement marked @available(macCatalyst, unavailable): guard it with !targetEnvironment(macCatalyst) to match StoreKit1Wrapper. Regenerates fastlane/README.md for the new test_catalyst lane. Co-authored-by: Cursor <cursoragent@cursor.com>
SKTestSession purchases come back as userCancelled on Mac Catalyst (the purchase dialog can't be suppressed in this headless environment), so the three SK2 tests that require a real completed purchase fail there. Skip them on Catalyst for now via XCTSkip; they keep running on all other platforms. Product fetching itself works fine on Catalyst. Co-authored-by: Cursor <cursoragent@cursor.com>
Route Mac Catalyst snapshots into their own `mac-catalyst-26` bucket, teach the `test_catalyst` lane to record snapshots via the CI-Snapshots test plan, and wire `run-test-mac-catalyst` into the snapshot generation workflow + snapshot PR step. Co-authored-by: Cursor <cursoragent@cursor.com>
Document the filed feedback (FB22922982) for the missing StoreKitTest macabi slice in the comments and XCTSkip message. Co-authored-by: Cursor <cursoragent@cursor.com>
A fully unsigned Mac Catalyst app has no application container, so SKTestSession cannot persist its configuration (disabling dialogs, clearing transactions, storefront overrides) and every write fails with SKInternalErrorDomain Code=3. That made purchase dialogs reappear and SK2 purchase tests come back userCancelled on Catalyst. Ad-hoc signing the host app (CODE_SIGN_IDENTITY=-, the equivalent of Xcode's "Sign to Run Locally") gives it a stable container, so the config writes succeed. With dialogs now suppressed, the three SK2 purchase tests that previously had to be skipped on Catalyst pass again. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Generated by 🚫 Danger |
Co-authored-by: Cursor <cursoragent@cursor.com>
Member
Author
|
@RCGitBot please test run-test-mac-catalyst-xcode-26 |
|
🚀 Triggered run-test-mac-catalyst-xcode-26 → Pipeline #38754 |
❌ CI Job Failed —
|
These tests ran for the first time on Mac Catalyst and asserted iOS- or macOS-native behavior that doesn't hold there: - PurchasesDiagnosticsTrackingTests: exclude Catalyst, where presentCodeRedemptionSheet() is unavailable (would crash with an unrecognized selector). - SandboxEnvironmentDetectorTests: route Catalyst to the macOS branch, since it detects sandbox via the receipt environment, not the URL path. - LocalReceiptParserStoreKitTests: treat Catalyst like macOS for the receipt applicationVersion. - HTTPClientTests: group Catalyst with iOS for identifierForVendor, which uses UIDevice (always present) there rather than the macOS sandbox gate. Co-authored-by: Cursor <cursoragent@cursor.com>
…urchases-ios into pallares/mac-catalyst-tests
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.
Checklist
purchases-androidand hybridsMotivation
StoreKit unit tests can't fetch products on iOS simulators with Xcode 26.4+ due to a StoreKit bug. This adds a Mac Catalyst test job on Xcode 26.5 to keep StoreKit coverage on a current Apple platform, where the bug doesn't reproduce.
Description
run-test-mac-catalyst-xcode-26job wired into the test/snapshot workflows and merge gates, with amac-catalyst-26snapshot bucket.SKTestSessiongets an app container; unsigned, its config writes fail withSKInternalErrorDomain Code=3, which breaks dialog suppression and purchases.setSimulatedError-based tests are compiled out on Catalyst (no macabi slice in the StoreKitTest overlay — Apple bug FB22922982).Made with Cursor