Skip to content

Commit

Permalink
Integration Tests: split into separate jobs (RevenueCat#3560)
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoSoto authored Jan 8, 2024
1 parent a685252 commit 793f4ab
Show file tree
Hide file tree
Showing 11 changed files with 475 additions and 35 deletions.
95 changes: 75 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,29 @@ commands:
name: Run << parameters.job >>
command: bundle exec fastlane << parameters.job >> version:"<< parameters.version >>"

run-backend-tests:
parameters:
test_plan:
type: string
steps:
- checkout
- install-dependencies
- update-spm-installation-commit
- run:
name: Run backend_integration Tests
command: bundle exec fastlane backend_integration_tests test_plan:"<< parameters.test_plan >>"
no_output_timeout: 5m
environment:
SCAN_DEVICE: iPhone 14 (16.4)
- compress_result_bundle:
directory: fastlane/test_output/xctest/ios
bundle_name: BackendIntegrationTests
- store_test_results:
path: fastlane/test_output
- store_artifacts:
path: fastlane/test_output/xctest
destination: scan-test-output

jobs:
spm-release-build-xcode-14:
<<: *base-job
Expand Down Expand Up @@ -673,26 +696,35 @@ jobs:
command: bundle exec fastlane build_visionos
no_output_timeout: 30m

backend-integration-tests:
backend-integration-tests-SK1:
<<: *base-job
steps:
- checkout
- install-dependencies
- update-spm-installation-commit
- run:
name: Run backend_integration Tests
command: bundle exec fastlane backend_integration_tests
no_output_timeout: 5m
environment:
SCAN_DEVICE: iPhone 14 (16.4)
- compress_result_bundle:
directory: fastlane/test_output/xctest/ios
bundle_name: BackendIntegrationTests
- store_test_results:
path: fastlane/test_output
- store_artifacts:
path: fastlane/test_output/xctest
destination: scan-test-output
- run-backend-tests:
test_plan: "BackendIntegrationTests-SK1"

backend-integration-tests-SK2:
<<: *base-job
steps:
- run-backend-tests:
test_plan: "BackendIntegrationTests-SK2"

backend-integration-tests-other:
<<: *base-job
steps:
- run-backend-tests:
test_plan: "BackendIntegrationTests-Other"

backend-integration-tests-offline:
<<: *base-job
steps:
- run-backend-tests:
test_plan: "BackendIntegrationTests-Offline"

backend-integration-tests-custom-entitlements:
<<: *base-job
steps:
- run-backend-tests:
test_plan: "BackendIntegrationTests-CustomEntitlements"

release-checks:
<<: *base-job
Expand Down Expand Up @@ -922,7 +954,7 @@ jobs:
bundle_name: v3LoadShedderIntegration
- run:
name: Backend and LoadShedder integration tests
command: bundle exec fastlane backend_integration_tests
command: bundle exec fastlane backend_integration_tests test_plan:"BackendIntegrationTests-All-CI"
no_output_timeout: 5m
environment:
SCAN_DEVICE: iPhone 14 (16.4)
Expand Down Expand Up @@ -1075,12 +1107,35 @@ workflows:
xcode_version: '14.3.0'
- build-visionos:
xcode_version: '15.1'
- backend-integration-tests:
- backend-integration-tests-SK1:
xcode_version: '14.3.0'
filters:
branches:
# Forked pull requests have CIRCLE_BRANCH set to pull/XXX
ignore: /pull\/[0-9]+/
- backend-integration-tests-SK2:
xcode_version: '14.3.0'
filters:
branches:
# Forked pull requests have CIRCLE_BRANCH set to pull/XXX
ignore: /pull\/[0-9]+/
- backend-integration-tests-other:
xcode_version: '14.3.0'
filters:
branches:
# Forked pull requests have CIRCLE_BRANCH set to pull/XXX
ignore: /pull\/[0-9]+/
- backend-integration-tests-offline:
xcode_version: '14.3.0'
# These tests are flaky due to FB13133387 so we don't want the noise in every PR
<<: *release-branches-and-main
- backend-integration-tests-custom-entitlements:
xcode_version: '14.3.0'
filters:
branches:
# Forked pull requests have CIRCLE_BRANCH set to pull/XXX
ignore: /pull\/[0-9]+/

deploy:
when:
not:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"configurations" : [
{
"id" : "62C79EF4-8071-439C-B693-34F1E57211FC",
"id" : "2587274F-F57F-4216-A271-AC81B1E55A3D",
"name" : "Configuration 1",
"options" : {
"testTimeoutsEnabled" : true

}
}
],
"defaultOptions" : {
"codeCoverage" : false,
"environmentVariableEntries" : [
{
"key" : "RCMockAdServicesToken",
"value" : "G9i5hC8lQJeGOfmS+MFycll"
},
{
"key" : "RCRunningTests",
"value" : "1"
},
{
"key" : "RCMockAdServicesToken",
"value" : "G9i5hC8lQJeGOfmS+MFycll"
},
{
"key" : "RCRunningIntegrationTests",
"value" : "1"
Expand All @@ -28,8 +28,8 @@
"maximumTestRepetitions" : 5,
"targetForVariableExpansion" : {
"containerPath" : "container:RevenueCat.xcodeproj",
"identifier" : "2DEAC2D926EFE46E006914ED",
"name" : "UnitTestsHostApp"
"identifier" : "2DE20B7E26409EB7004C597D",
"name" : "BackendIntegrationTestsHostApp"
},
"testExecutionOrdering" : "random",
"testRepetitionMode" : "retryOnFailure",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"configurations" : [
{
"id" : "62C79EF4-8071-439C-B693-34F1E57211FC",
"name" : "Configuration 1",
"options" : {
"testTimeoutsEnabled" : true
}
}
],
"defaultOptions" : {
"codeCoverage" : false,
"environmentVariableEntries" : [
{
"key" : "RCMockAdServicesToken",
"value" : "G9i5hC8lQJeGOfmS+MFycll"
},
{
"key" : "RCRunningTests",
"value" : "1"
},
{
"key" : "RCRunningIntegrationTests",
"value" : "1"
}
],
"maximumTestExecutionTimeAllowance" : 180,
"maximumTestRepetitions" : 5,
"targetForVariableExpansion" : {
"containerPath" : "container:RevenueCat.xcodeproj",
"identifier" : "4F6BEE042A27B02400CD9322",
"name" : "BackendCustomEntitlementsIntegrationTests"
},
"testExecutionOrdering" : "random",
"testRepetitionMode" : "retryOnFailure",
"testTimeoutsEnabled" : true
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:RevenueCat.xcodeproj",
"identifier" : "4F6BEE042A27B02400CD9322",
"name" : "BackendCustomEntitlementsIntegrationTests"
}
}
],
"version" : 1
}
76 changes: 76 additions & 0 deletions BackendIntegrationTests/BackendIntegrationTests-Offline.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"configurations" : [
{
"id" : "62C79EF4-8071-439C-B693-34F1E57211FC",
"name" : "Configuration 1",
"options" : {
"testTimeoutsEnabled" : true
}
}
],
"defaultOptions" : {
"codeCoverage" : false,
"environmentVariableEntries" : [
{
"key" : "RCMockAdServicesToken",
"value" : "G9i5hC8lQJeGOfmS+MFycll"
},
{
"key" : "RCRunningTests",
"value" : "1"
},
{
"key" : "RCRunningIntegrationTests",
"value" : "1"
}
],
"maximumTestExecutionTimeAllowance" : 180,
"maximumTestRepetitions" : 5,
"targetForVariableExpansion" : {
"containerPath" : "container:RevenueCat.xcodeproj",
"identifier" : "2DE20B6B264087FB004C597D",
"name" : "BackendIntegrationTests"
},
"testExecutionOrdering" : "random",
"testRepetitionMode" : "retryOnFailure",
"testTimeoutsEnabled" : true
},
"testTargets" : [
{
"skippedTests" : [
"BaseBackendIntegrationTests",
"BaseSignatureVerificationIntegrationTests",
"BaseStoreKitIntegrationTests",
"BaseStoreKitObserverModeIntegrationTests",
"DisabledSignatureVerificationIntegrationTests",
"DynamicModeSignatureVerificationIntegrationTests",
"EnforcedSignatureVerificationIntegrationTests",
"InformationalSignatureVerificationIntegrationTests",
"LoadShedderSignatureVerificationWithoutHeaderHashIntegrationTests",
"LoadShedderStoreKit1IntegrationTests",
"LoadShedderStoreKit2IntegrationTests",
"LoadShedderStoreKit2JWSIntegrationTests",
"OtherIntegrationTests",
"PaywallEventsIntegrationTests",
"SignatureVerificationWithoutHeaderHashIntegrationTests",
"StoreKit1IntegrationTests",
"StoreKit1ObserverModeIntegrationTests",
"StoreKit1ObserverModeWithExistingPurchasesTests",
"StoreKit2IntegrationTests",
"StoreKit2JWSIntegrationTests",
"StoreKit2JWSObserverModeIntegrationTests",
"StoreKit2JWSObserverModeWithExistingPurchasesTests",
"StoreKit2ObserverModeIntegrationTests",
"StoreKit2ObserverModeWithExistingPurchasesTests",
"SubscriberAttributesManagerIntegrationTests",
"TestCase"
],
"target" : {
"containerPath" : "container:RevenueCat.xcodeproj",
"identifier" : "2DE20B6B264087FB004C597D",
"name" : "BackendIntegrationTests"
}
}
],
"version" : 1
}
69 changes: 69 additions & 0 deletions BackendIntegrationTests/BackendIntegrationTests-Other.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"configurations" : [
{
"id" : "62C79EF4-8071-439C-B693-34F1E57211FC",
"name" : "Configuration 1",
"options" : {
"testTimeoutsEnabled" : true
}
}
],
"defaultOptions" : {
"codeCoverage" : false,
"environmentVariableEntries" : [
{
"key" : "RCMockAdServicesToken",
"value" : "G9i5hC8lQJeGOfmS+MFycll"
},
{
"key" : "RCRunningTests",
"value" : "1"
},
{
"key" : "RCRunningIntegrationTests",
"value" : "1"
}
],
"maximumTestExecutionTimeAllowance" : 180,
"maximumTestRepetitions" : 5,
"targetForVariableExpansion" : {
"containerPath" : "container:RevenueCat.xcodeproj",
"identifier" : "2DE20B6B264087FB004C597D",
"name" : "BackendIntegrationTests"
},
"testExecutionOrdering" : "random",
"testRepetitionMode" : "retryOnFailure",
"testTimeoutsEnabled" : true
},
"testTargets" : [
{
"skippedTests" : [
"BaseBackendIntegrationTests",
"BaseOfflineStoreKitIntegrationTests",
"LoadShedderStoreKit1IntegrationTests",
"LoadShedderStoreKit2IntegrationTests",
"LoadShedderStoreKit2JWSIntegrationTests",
"OfflineStoreKit1IntegrationTests",
"OfflineStoreKit2IntegrationTests",
"OfflineStoreKit2JWSIntegrationTests",
"OfflineWithNoMappingStoreKitIntegrationTests",
"StoreKit1IntegrationTests",
"StoreKit1ObserverModeIntegrationTests",
"StoreKit1ObserverModeWithExistingPurchasesTests",
"StoreKit2IntegrationTests",
"StoreKit2JWSIntegrationTests",
"StoreKit2JWSObserverModeIntegrationTests",
"StoreKit2JWSObserverModeWithExistingPurchasesTests",
"StoreKit2ObserverModeIntegrationTests",
"StoreKit2ObserverModeWithExistingPurchasesTests",
"TestCase"
],
"target" : {
"containerPath" : "container:RevenueCat.xcodeproj",
"identifier" : "2DE20B6B264087FB004C597D",
"name" : "BackendIntegrationTests"
}
}
],
"version" : 1
}
Loading

0 comments on commit 793f4ab

Please sign in to comment.