Skip to content

Commit

Permalink
Fix tests in main (#4174)
Browse files Browse the repository at this point in the history
Fixes the tests that were failing in `main`, which you can see in
#4172
  • Loading branch information
aboedo authored and nyeu committed Oct 1, 2024
1 parent 8128966 commit 73c2ed5
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ jobs:
spm-revenuecat-ui-ios-16:
executor:
name: macos-executor
xcode_version: '14.3.0'
xcode_version: '15.4.0'

steps:
- checkout
Expand Down Expand Up @@ -653,7 +653,7 @@ jobs:
run-test-ios-16:
executor:
name: macos-executor
xcode_version: '14.3.0'
xcode_version: '15.4.0'

steps:
- checkout
Expand Down
12 changes: 11 additions & 1 deletion RevenueCat.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
2D222BAB27FB7008003D5F37 /* LocalReceiptParserStoreKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D222BAA27FB7008003D5F37 /* LocalReceiptParserStoreKitTests.swift */; };
2D22BF6826F3CC6D001AE2F9 /* XCTestCase+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D22BF6626F3CBFB001AE2F9 /* XCTestCase+Extensions.swift */; };
2D294E5C26DECFD500B8FE4F /* StoreKit2TransactionListener.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D294E5B26DECFD500B8FE4F /* StoreKit2TransactionListener.swift */; };
2D2AFE8D2C6A834D00D1B0B4 /* TestData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 887A5FDA2C1D037000E1A461 /* TestData.swift */; };
2D2AFE8F2C6A9D8700D1B0B4 /* CompatibilityContentUnavailableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D2AFE8E2C6A9D8700D1B0B4 /* CompatibilityContentUnavailableView.swift */; };
2D2AFE912C6A9EF500D1B0B4 /* Binding+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D2AFE902C6A9EF500D1B0B4 /* Binding+Extensions.swift */; };
2D34D9D227481D9B00C05DB6 /* TrialOrIntroPriceEligibilityCheckerSK2Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D34D9D127481D9B00C05DB6 /* TrialOrIntroPriceEligibilityCheckerSK2Tests.swift */; };
2D3BFAD126DEA45C00370B11 /* MockSK1Product.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DDF41E524F6F5DC005BC22D /* MockSK1Product.swift */; };
2D3BFAD226DEA46600370B11 /* MockProductsRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37E35B08709090FBBFB16EBD /* MockProductsRequest.swift */; };
Expand Down Expand Up @@ -1140,6 +1143,8 @@
2D222BAA27FB7008003D5F37 /* LocalReceiptParserStoreKitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalReceiptParserStoreKitTests.swift; sourceTree = "<group>"; };
2D22BF6626F3CBFB001AE2F9 /* XCTestCase+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCTestCase+Extensions.swift"; sourceTree = "<group>"; };
2D294E5B26DECFD500B8FE4F /* StoreKit2TransactionListener.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreKit2TransactionListener.swift; sourceTree = "<group>"; };
2D2AFE8E2C6A9D8700D1B0B4 /* CompatibilityContentUnavailableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CompatibilityContentUnavailableView.swift; sourceTree = "<group>"; };
2D2AFE902C6A9EF500D1B0B4 /* Binding+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Binding+Extensions.swift"; path = "RevenueCatUI/Binding+Extensions.swift"; sourceTree = SOURCE_ROOT; };
2D34D9D127481D9B00C05DB6 /* TrialOrIntroPriceEligibilityCheckerSK2Tests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TrialOrIntroPriceEligibilityCheckerSK2Tests.swift; sourceTree = "<group>"; };
2D43017726EBFD7100BAB891 /* UnitTestsConfiguration.storekit */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = UnitTestsConfiguration.storekit; sourceTree = "<group>"; };
2D4C60F02C5AD1C300A29FD2 /* AllAPITests.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = AllAPITests.xcodeproj; path = Tests/APITesters/AllAPITests/AllAPITests.xcodeproj; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1946,7 +1951,7 @@
887A63212C1D174200E1A461 /* RevenueCatUITestsDev.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RevenueCatUITestsDev.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
887A63482C1D17A200E1A461 /* RevenueCatUIDev.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; name = RevenueCatUIDev.xctestplan; path = RevenueCatUI/RevenueCatUIDev.xctestplan; sourceTree = SOURCE_ROOT; };
887E7B582C13CD2C002977DE /* PurchasesAreCompletedBy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PurchasesAreCompletedBy.swift; sourceTree = "<group>"; };
88A543DE2C37A45B0039C6A5 /* TemplatePackageSetting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TemplatePackageSetting.swift; path = RevenueCatUI/TemplatePackageSetting.swift; sourceTree = SOURCE_ROOT; };
88A543DE2C37A45B0039C6A5 /* TemplatePackageSetting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TemplatePackageSetting.swift; path = RevenueCatUI/Views/TemplatePackageSetting.swift; sourceTree = SOURCE_ROOT; };
88A543E02C37A4820039C6A5 /* TemplateView+MultiTier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TemplateView+MultiTier.swift"; sourceTree = "<group>"; };
88A543E22C37A4970039C6A5 /* Template7View.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Template7View.swift; sourceTree = "<group>"; };
88A543E42C37A4AF0039C6A5 /* ConsistentTierContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConsistentTierContentView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3131,6 +3136,7 @@
353756602C382C2800A1B8D6 /* Views */ = {
isa = PBXGroup;
children = (
2D2AFE8E2C6A9D8700D1B0B4 /* CompatibilityContentUnavailableView.swift */,
3537565B2C382C2800A1B8D6 /* CustomerCenterView.swift */,
35C200B02C39254100B9778B /* FeedbackSurveyView.swift */,
3537565C2C382C2800A1B8D6 /* ManageSubscriptionsView.swift */,
Expand Down Expand Up @@ -4044,6 +4050,7 @@
887A604F2C1D037000E1A461 /* Templates */,
887A60522C1D037000E1A461 /* UIKit */,
887A605F2C1D037000E1A461 /* Views */,
2D2AFE902C6A9EF500D1B0B4 /* Binding+Extensions.swift */,
887A60602C1D037000E1A461 /* PaywallFontProvider.swift */,
887A60612C1D037000E1A461 /* PaywallView.swift */,
887A60622C1D037000E1A461 /* View+PresentPaywall.swift */,
Expand Down Expand Up @@ -5804,7 +5811,9 @@
887A60BC2C1D037000E1A461 /* Template5View.swift in Sources */,
887A60BE2C1D037000E1A461 /* PaywallFooterViewController.swift in Sources */,
887A608A2C1D037000E1A461 /* PurchaseHandler.swift in Sources */,
2D2AFE8D2C6A834D00D1B0B4 /* TestData.swift in Sources */,
887A60C92C1D037000E1A461 /* PurchaseButton.swift in Sources */,
2D2AFE912C6A9EF500D1B0B4 /* Binding+Extensions.swift in Sources */,
887A60812C1D037000E1A461 /* PaywallData+Default.swift in Sources */,
887A606A2C1D037000E1A461 /* TrialOrIntroEligibilityChecker.swift in Sources */,
3546355F2C391F4D001D7E85 /* PromotionalOfferView.swift in Sources */,
Expand All @@ -5814,6 +5823,7 @@
887A60892C1D037000E1A461 /* PaywallPurchasesType.swift in Sources */,
3537566F2C382C2800A1B8D6 /* WrongPlatformView.swift in Sources */,
887A60C22C1D037000E1A461 /* ErrorDisplay.swift in Sources */,
2D2AFE8F2C6A9D8700D1B0B4 /* CompatibilityContentUnavailableView.swift in Sources */,
3537566E2C382C2800A1B8D6 /* RestorePurchasesAlert.swift in Sources */,
887A60692C1D037000E1A461 /* IntroEligibilityViewModel.swift in Sources */,
88A543E32C37A4970039C6A5 /* Template7View.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import SwiftUI
#if os(iOS)

/// A SwiftUI view for displaying a message about unavailable content
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
@available(iOS 15.0, *)
@available(macOS, unavailable)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
Expand All @@ -30,12 +30,20 @@ struct CompatibilityContentUnavailableView: View {

var body: some View {

if #available(iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, *) {
ContentUnavailableView(
title,
systemImage: systemImage,
description: Text(description)
)
if #available(iOS 17.0, *) {
#if swift(>=5.9)
ContentUnavailableView(
title,
systemImage: systemImage,
description: Text(description)
)
#else
// In Xcode 14, any references to ContentUnavailableView would fail to compile since that entity
// was included with Xcode 15 and later.
// Although Xcode 15 is required for App Store builds, we have some CI processes that run in Xcode 14
// so this retains compatibility while not affecting any real world usage.
EmptyView()
#endif
} else {
VStack {
Image(systemName: systemImage)
Expand Down
2 changes: 1 addition & 1 deletion RevenueCatUI/CustomerCenter/Views/CustomerCenterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import SwiftUI
#if os(iOS)

/// A SwiftUI view for displaying a customer support common tasks
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
@available(iOS 15.0, *)
@available(macOS, unavailable)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
Expand Down
2 changes: 1 addition & 1 deletion RevenueCatUI/CustomerCenter/Views/WrongPlatformView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import SwiftUI

#if os(iOS)

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
@available(iOS 15.0, *)
@available(macOS, unavailable)
@available(tvOS, unavailable)
@available(watchOS, unavailable)
Expand Down
File renamed without changes.
30 changes: 3 additions & 27 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,37 +154,13 @@ archive

archive all platforms

### ios build_swift_api_tester
### ios run_api_tests

```sh
[bundle exec] fastlane ios build_swift_api_tester
[bundle exec] fastlane ios run_api_tests
```

build Swift API tester

### ios build_objc_api_tester

```sh
[bundle exec] fastlane ios build_objc_api_tester
```

build ObjC API tester

### ios build_custom_entitlement_computation_api_tester

```sh
[bundle exec] fastlane ios build_custom_entitlement_computation_api_tester
```

build CustomEntitlementComputation API tester

### ios build_revenuecatui_api_tester

```sh
[bundle exec] fastlane ios build_revenuecatui_api_tester
```

build RevenueCatUI API tester
run API Tests

### ios replace_api_key_integration_tests

Expand Down

0 comments on commit 73c2ed5

Please sign in to comment.