Skip to content

Use Tuist workspace for BackendIntegrationTests in CI#6774

Merged
facumenzella merged 7 commits into
mainfrom
worktree-luminous-wandering-river
Jun 15, 2026
Merged

Use Tuist workspace for BackendIntegrationTests in CI#6774
facumenzella merged 7 commits into
mainfrom
worktree-luminous-wandering-river

Conversation

@facumenzella

@facumenzella facumenzella commented May 12, 2026

Copy link
Copy Markdown
Member

Summary

  • Switches the run-backend-tests CI job to build from the Tuist-generated workspace (RevenueCat-Tuist.xcworkspace) instead of the legacy RevenueCat.xcodeproj
  • Adds a tuist-generate-workspace step (with include_test_dependencies: true) to run-backend-tests before invoking fastlane
  • Pins the backend_integration_tests Fastfile lane to the Tuist workspace explicitly via workspace: 'RevenueCat-Tuist.xcworkspace'
  • Adds all 8 BackendIntegrationTests test plans to the Tuist scheme so xcodebuild's -testPlan flag can resolve each one (SK1, SK2, Offline, Other, CustomEntitlements, LoadShedder, All, All-CI)

Part of the longer-term goal of deleting RevenueCat.xcodeproj + RevenueCat.xcworkspace.

Test plan

  • CI backend-integration-tests-SK1 through backend-integration-tests-offline jobs pass
  • CI backend-integration-tests-custom-entitlements passes
  • No regressions in other CI jobs

🤖 Generated with Claude Code


Note

Medium Risk
Changes how backend integration tests are built and which SDK module the custom-entitlements target links; failures would show up as CI breakage rather than shipping SDK regressions, but purchase/backend coverage depends on these jobs.

Overview
Moves BackendIntegrationTests CI onto the Tuist-generated RevenueCat-Tuist.xcworkspace: run-backend-tests now runs tuist-generate-workspace with include_test_dependencies: true, and the backend_integration_tests Fastlane lane passes workspace: 'RevenueCat-Tuist.xcworkspace' to scan.

All eight .xctestplan files now point at RevenueCatTests.xcodeproj and updated target identifiers instead of RevenueCat.xcodeproj. The Tuist BackendIntegrationTests scheme registers every test plan (All, All-CI, SK1, SK2, Offline, Other, CustomEntitlements, LoadShedder) so CI -testPlan selection still works.

Projects/RevenueCatTests/Project.swift trims host-app build settings, tightens BackendCustomEntitlementsIntegrationTests (excludes RevenueCat-only helpers, adds StoreKit config resource), and wires the full test-plan list on the scheme. MainThreadMonitor.swift and StoreKitTestHelpers.swift use conditional imports so they compile in both the standard and custom-entitlement test targets.

Reviewed by Cursor Bugbot for commit 60ea68c. Bugbot is set up for automated code reviews on this repo. Configure here.

@facumenzella facumenzella marked this pull request as ready for review June 12, 2026 13:48
@facumenzella facumenzella requested a review from a team as a code owner June 12, 2026 13:48
facumenzella and others added 6 commits June 12, 2026 16:35
The scheme previously only linked BackendIntegrationTests-All-CI, so
xcodebuild's -testPlan flag would fail to resolve the individual plans
(SK1, SK2, Offline, etc.) used by each CI job.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without an explicit workspace, fastlane's scan autodiscovered
RevenueCat.xcodeproj instead of the Tuist-generated workspace.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The run-backend-tests job previously relied on RevenueCat.xcodeproj via
scan's autodiscovery. Adding tuist-generate-workspace ensures the
RevenueCat-Tuist.xcworkspace exists before fastlane runs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The host app was incorrectly configured with APPLICATION_EXTENSION_API_ONLY=YES
and ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION, which don't match the old xcodeproj
and caused test failures when running from the Tuist workspace.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All 8 BackendIntegrationTests test plans hardcoded container:RevenueCat.xcodeproj
with old xcodeproj target UUIDs. In the Tuist workspace, these targets live in
RevenueCatTests.xcodeproj — xcodebuild couldn't find any test bundles without this.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Tuist BackendCustomEntitlementsIntegrationTests target links only
RevenueCat_CustomEntitlementComputation, but several sources imported the
plain RevenueCat module, leaving RevenueCat.* symbols undefined at link time.

- Exclude the SK1/SK2 product fetchers and observer/external purchase managers
  from the target glob (they import RevenueCat directly and aren't used here)
- Guard MainThreadMonitor and StoreKitTestHelpers with the existing
  ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION conditional import

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@facumenzella facumenzella force-pushed the worktree-luminous-wandering-river branch from 1aa797b to 17d39dd Compare June 12, 2026 14:52
The BackendCustomEntitlementsIntegrationTests target didn't bundle
RevenueCat_IntegrationPurchaseTesterConfiguration.storekit, so
SKTestSession(configurationFileNamed:) failed at runtime with
SKTestErrorDomain Code=4 "File not found". Add the resource, matching
the regular BackendIntegrationTests target.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@ajpallares ajpallares left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense! A bit closer now! 💪 Thanks!

@facumenzella

Copy link
Copy Markdown
Member Author

[ci/circleci: run-test-ios-15-and-14](https://circleci.com/gh/RevenueCat/purchases-ios/619555)looks like a hiccup, we're good

@facumenzella facumenzella merged commit f33fc2f into main Jun 15, 2026
39 of 42 checks passed
@facumenzella facumenzella deleted the worktree-luminous-wandering-river branch June 15, 2026 08:10
facumenzella added a commit that referenced this pull request Jun 15, 2026
…oj (#7006)

These targets (BackendIntegrationTests, BackendCustomEntitlementsIntegrationTests,
BackendIntegrationTestsHostApp) now run via RevenueCat-Tuist.xcworkspace after #6774,
so they're dead weight in the legacy project. Also removes the dead
BackendIntegrationTests scheme and the now-orphaned file/group references.
Test source files stay on disk (owned by the Tuist RevenueCatTests project).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants