Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Paywalls] Fix iOS 13/14 tests #4568

Merged
merged 3 commits into from
Dec 11, 2024
Merged

[Paywalls] Fix iOS 13/14 tests #4568

merged 3 commits into from
Dec 11, 2024

Conversation

MarkVillacampa
Copy link
Member

This PR fixes running iOS 13/14 tests with Xcode 14 by removing the direct dependency on the SnapshotPreviews package and instead depending on it through a SnapshotTestingStub package.

Why is SnapshotTestingStub needed?

At the time of the writing, we still support iOS 13 and iOS 14, which need macOS 12 to run tests in the simulator.
CircleCI bundles Xcode 14.2 with the macOS 12 image, which comes with Swift 5.7.
Emerge's SnapshotPreviews package currently has a dependency on the https://github.com/swhitty/FlyingFox package version 0.16 which requires Swift 5.8.
When we open Revenuecat.xcodeproj in Xcode 14.2, it tries to pull all dependencies, including SnapshotPreviews, and fails to build because of the FlyingFox dependency.
This prevents us from running tests in the iOS 13 and iOS 14 simulators.
It is not possible to add a package to an Xcode project conditionally on the Swift version used, but we can create a stub package that only depends on SnapshotPreviews,
and only pulls the dependency for Swift 5.8.

@MarkVillacampa
Copy link
Member Author

@RCGitBot please test

// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "SnapshotTestingStub", dependencies: [.product(name: "SnapshottingTests", package: "SnapshotPreviews")]),
Copy link
Contributor

Choose a reason for hiding this comment

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

very smart

@vegaro vegaro merged commit e05feb4 into main Dec 11, 2024
37 checks passed
@vegaro vegaro deleted the remove-emerge-release branch December 11, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants