Skip to content

Commit

Permalink
split test suite in 3 plans and run them in different actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Valeriu Popa committed Dec 22, 2023
1 parent 8519a73 commit 2aa4c42
Show file tree
Hide file tree
Showing 15 changed files with 210 additions and 1,644 deletions.
150 changes: 124 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,163 @@
name: Test

on:
push:
push:
branches:
- main
- feature/*
pull_request:
workflow_dispatch:
- main
- feature/*
pull_request:
workflow_dispatch:

env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer

jobs:
test:
test_0:
runs-on: macos-latest

steps:
- name: Checkout
- name: Checkout
uses: actions/checkout@v3

- name: Ruby & Bundle setup
- name: Ruby & Bundle setup
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
ruby-version: 2.6
bundler-cache: true

- name: Cocoapods cache
- name: Cocoapods cache
uses: actions/cache@v3
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-

- name: Cocoapods install
- name: Cocoapods install
run: |
bundle exec fastlane run cocoapods
- name: Setup Java 11
- name: Setup Java 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
distribution: 'temurin'
java-version: '11'

- name: WireMock setup
- name: WireMock setup
run: |
curl https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-standalone/2.27.0/wiremock-jre8-standalone-2.27.0.jar -o wiremock.jar -s
bundle exec iostrust add ./wiremock/cert/wiremock.crt
java -jar wiremock.jar --https-port 9099 --root-dir wiremock --https-keystore wiremock/cert/wiremock.jks --keystore-password password --verbose --global-response-templating &
- name: Format check
- name: Format check
run: |
bundle exec fastlane format_check
- name: Test
- name: Test
run: |
bundle exec fastlane test
bundle exec fastlane test_0
- name: Tests reports upload
- name: Tests reports upload
uses: actions/upload-artifact@v3
if: failure()
with:
name: tests-reports
path: "fastlane/test_output"
name: tests-reports
path: "fastlane/test_output"

test_1:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Ruby & Bundle setup
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true

- name: Cocoapods cache
uses: actions/cache@v3
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-

- name: Cocoapods install
run: |
bundle exec fastlane run cocoapods
- name: Setup Java 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: WireMock setup
run: |
curl https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-standalone/2.27.0/wiremock-jre8-standalone-2.27.0.jar -o wiremock.jar -s
bundle exec iostrust add ./wiremock/cert/wiremock.crt
java -jar wiremock.jar --https-port 9099 --root-dir wiremock --https-keystore wiremock/cert/wiremock.jks --keystore-password password --verbose --global-response-templating &
- name: Test
run: |
bundle exec fastlane test_1
- name: Tests reports upload
uses: actions/upload-artifact@v3
if: failure()
with:
name: tests-reports
path: "fastlane/test_output"

test_2:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Ruby & Bundle setup
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true

- name: Cocoapods cache
uses: actions/cache@v3
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-

- name: Cocoapods install
run: |
bundle exec fastlane run cocoapods
- name: Setup Java 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'

- name: WireMock setup
run: |
curl https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-jre8-standalone/2.27.0/wiremock-jre8-standalone-2.27.0.jar -o wiremock.jar -s
bundle exec iostrust add ./wiremock/cert/wiremock.crt
java -jar wiremock.jar --https-port 9099 --root-dir wiremock --https-keystore wiremock/cert/wiremock.jks --keystore-password password --verbose --global-response-templating &
- name: Test
run: |
bundle exec fastlane test_2
- name: Tests reports upload
uses: actions/upload-artifact@v3
if: failure()
with:
name: tests-reports
path: "fastlane/test_output"


16 changes: 1 addition & 15 deletions CriteoPublisherSdk/CriteoPublisherSdk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -729,14 +729,7 @@
A82D7DF12A04FEAB001302A8 /* CRMRAIDUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CRMRAIDUtils.swift; sourceTree = "<group>"; };
A82D7DF32A0A3ED4001302A8 /* MRAIDUtilsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MRAIDUtilsTests.swift; sourceTree = "<group>"; };
A82D7E1D2A20B28E001302A8 /* CriteoPublisherSdkMC1.xctestplan */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CriteoPublisherSdkMC1.xctestplan; sourceTree = "<group>"; };
A82D7E1E2A20B28E001302A8 /* CriteoPublisherSdkMC9.xctestplan */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CriteoPublisherSdkMC9.xctestplan; sourceTree = "<group>"; };
A82D7E1F2A20B28E001302A8 /* CriteoPublisherSdkMC4.xctestplan */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CriteoPublisherSdkMC4.xctestplan; sourceTree = "<group>"; };
A82D7E202A20B28E001302A8 /* CriteoPublisherSdkMC3.xctestplan */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CriteoPublisherSdkMC3.xctestplan; sourceTree = "<group>"; };
A82D7E212A20B28E001302A8 /* CriteoPublisherSdkMC6.xctestplan */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CriteoPublisherSdkMC6.xctestplan; sourceTree = "<group>"; };
A82D7E222A20B28E001302A8 /* CriteoPublisherSdkMC8.xctestplan */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CriteoPublisherSdkMC8.xctestplan; sourceTree = "<group>"; };
A82D7E232A20B28E001302A8 /* CriteoPublisherSdkMC5.xctestplan */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CriteoPublisherSdkMC5.xctestplan; sourceTree = "<group>"; };
A82D7E242A20B28E001302A8 /* CriteoPublisherSdkMC0.xctestplan */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CriteoPublisherSdkMC0.xctestplan; sourceTree = "<group>"; };
A82D7E252A20B28E001302A8 /* CriteoPublisherSdkMC7.xctestplan */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CriteoPublisherSdkMC7.xctestplan; sourceTree = "<group>"; };
A82D7E262A20B28E001302A8 /* CriteoPublisherSdkMC2.xctestplan */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CriteoPublisherSdkMC2.xctestplan; sourceTree = "<group>"; };
A83BB58929BAEB69002A63B6 /* ActionRepresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionRepresentable.swift; sourceTree = "<group>"; };
A83BB58B29BAEBC9002A63B6 /* MRAIDLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MRAIDLog.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1576,15 +1569,8 @@
A82D7E1C2A20B28E001302A8 /* TestPlans */ = {
isa = PBXGroup;
children = (
A82D7E1D2A20B28E001302A8 /* CriteoPublisherSdkMC1.xctestplan */,
A82D7E1E2A20B28E001302A8 /* CriteoPublisherSdkMC9.xctestplan */,
A82D7E1F2A20B28E001302A8 /* CriteoPublisherSdkMC4.xctestplan */,
A82D7E202A20B28E001302A8 /* CriteoPublisherSdkMC3.xctestplan */,
A82D7E212A20B28E001302A8 /* CriteoPublisherSdkMC6.xctestplan */,
A82D7E222A20B28E001302A8 /* CriteoPublisherSdkMC8.xctestplan */,
A82D7E232A20B28E001302A8 /* CriteoPublisherSdkMC5.xctestplan */,
A82D7E242A20B28E001302A8 /* CriteoPublisherSdkMC0.xctestplan */,
A82D7E252A20B28E001302A8 /* CriteoPublisherSdkMC7.xctestplan */,
A82D7E1D2A20B28E001302A8 /* CriteoPublisherSdkMC1.xctestplan */,
A82D7E262A20B28E001302A8 /* CriteoPublisherSdkMC2.xctestplan */,
);
path = TestPlans;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,12 @@
<TestPlanReference
reference = "container:Tests/TestPlans/CriteoPublisherSdkMC1.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:Tests/TestPlans/CriteoPublisherSdkMC3.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:Tests/TestPlans/CriteoPublisherSdkMC0.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:Tests/TestPlans/CriteoPublisherSdkMC2.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:Tests/TestPlans/CriteoPublisherSdkMC4.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:Tests/TestPlans/CriteoPublisherSdkMC5.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:Tests/TestPlans/CriteoPublisherSdkMC6.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:Tests/TestPlans/CriteoPublisherSdkMC7.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:Tests/TestPlans/CriteoPublisherSdkMC8.xctestplan">
</TestPlanReference>
<TestPlanReference
reference = "container:Tests/TestPlans/CriteoPublisherSdkMC9.xctestplan">
</TestPlanReference>
</TestPlans>
<Testables>
<TestableReference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,8 @@
"CR_BidManagerIntegrationTests\/test_givenPrefetchingBid_whenSilenceModeBid_shouldProvideEmptyBid",
"CR_BidManagerIntegrationTests\/test_givenPrefetchingBid_whenUserSilenceModeBid_shouldProvideEmptyBid",
"CR_BidPerformanceTests\/test500Bids",
"CR_BidRequestSerializerTests",
"CR_CASBoundedFileObjectQueueTests",
"CR_CacheAdUnitTests",
"CR_CacheManagerTests",
"CR_CdbBidTests",
"CR_CdbResponseTests",
"CR_ConfigManagerTests",
"CR_ConfigTests",
"CR_ContextualFunctionalTests",
"CR_DataConsentFunctionalTests",
"CR_DataProtectionConsentTests",
"CR_DefaultFileManipulatorTests",
"CR_DefaultMediaDownloaderTests",
"CR_DeviceInfoTests",
"CR_DfpBannerFunctionalTests",
"CR_DfpBannerFunctionalTests\/test_givenValidBanner_whenLoadingDfpBanner_thenDfpViewContainsCreative",
"CR_DfpInterstitialFunctionalTests",
"CR_DfpInterstitialFunctionalTests\/test_givenValidInterstitial_whenLoadingDfpInterstitial_thenDfpViewContainsCreative",
"CR_DfpNativeFunctionalTests",
"CR_DfpRewardedFunctionalTests",
"CR_DisplaySizeInjectorTests",
"CR_FeedbackControllerTests",
"CR_FeedbackControllerTests\/testOnCdbCallFailure_GivenTimeoutError_UpdateAllForTimeout",
"CR_FeedbackFeatureGuardTests",
Expand Down Expand Up @@ -175,6 +156,7 @@
"CR_RemoteLogRecordSerializerTests",
"CR_RemoteLogRecordTests",
"CR_RemoteLogStorageTests",
"CR_SKAdNetworkImpressionTests",
"CR_SKAdNetworkParametersTests",
"CR_SafeMediaDownloaderTests",
"CR_StandaloneBannerFunctionalTests",
Expand Down
40 changes: 11 additions & 29 deletions CriteoPublisherSdk/Tests/TestPlans/CriteoPublisherSdkMC1.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@
"CR_BidPerformanceTests",
"CR_BidPerformanceTests\/test500Bids",
"CR_BidRequestSerializerSwiftTests",
"CR_BidRequestSerializerTests",
"CR_CASBoundedFileObjectQueueTests",
"CR_CacheAdUnitTests",
"CR_CacheManagerTests",
"CR_CdbBidTests",
"CR_CdbResponseTests",
"CR_ConfigManagerTests",
"CR_ConfigTests",
"CR_ContextualFunctionalTests",
"CR_DataConsentFunctionalTests",
"CR_DataProtectionConsentTests",
"CR_DefaultFileManipulatorTests",
"CR_DefaultMediaDownloaderTests",
Expand All @@ -81,50 +91,28 @@
"CR_DfpNativeFunctionalTests",
"CR_DfpRewardedFunctionalTests",
"CR_DisplaySizeInjectorTests",
"CR_FeedbackControllerTests",
"CR_FeedbackControllerTests\/testOnCdbCallFailure_GivenTimeoutError_UpdateAllForTimeout",
"CR_FeedbackFeatureGuardTests",
"CR_FeedbackFileManagerTests",
"CR_FeedbackMessageFunctionalTests",
"CR_FeedbackMessageFunctionalTests\/testGivenFeedbackRequestError_whenLiveBidsTimeBudgetExceeded_thenFeedbackRequest",
"CR_FeedbackMessageFunctionalTests\/testGivenTimeoutErrorOnPrefetch_whenGettingBid_thenSendFeedbackMessage",
"CR_FeedbackMessageFunctionalTests\/testGivenTimeoutErrorOnPrefetch_whenGettingLiveBid_thenSendFeedbackMessage",
"CR_FeedbackMessageFunctionalTests\/testGivenTimeoutErrorOnPrefetch_whenLiveBidTimeBudgetExceeded_thenSendFeedbackMessage",
"CR_FeedbackMessageTests",
"CR_FeedbackMessageTests\/testFullyFilledObjectsAreEqual()",
"CR_FeedbackSerializerTests",
"CR_FeedbackSerializerTests\/testAnyMessageContainsSlotsField()",
"CR_FeedbackSerializerTests\/testConfigValuesPassed()",
"CR_FeedbackStorageTests",
"CR_FeedbackStorageTests\/test_initWithActiveMessages_ShouldBeMovedToSendingQueue()",
"CR_FeedbackStorageTests\/test_requestFor_ReadyToSendMessages_ShouldReturnEverythingFromQueue()",
"CR_FeedbackStorageTests\/test_updateByDifferentAdUnit_shouldReadByDifferentFilename()",
"CR_FeedbackStorageTests\/test_updateBySameAdUnit_shouldReadBySameFilename()",
"CR_FeedbackStorageTests\/test_updateMessageToRTS_messageShouldBeMovedToSendingQueue()",
"CR_FeedbackStorageTests\/test_updateNonexistentMessage_ShouldCreateFile()",
"CR_GdprSerializerTests",
"CR_GdprSerializerTests\/testGdprTcf1()",
"CR_GdprSerializerTests\/testGdprTcf2()",
"CR_GdprSerializerTests\/testNoConsentString()",
"CR_GdprSerializerTests\/testNoGdprApplies()",
"CR_GdprTests",
"CR_GdprTests\/testBadConsentStringTypeInUserDefaultsTcf2_0",
"CR_HeaderBiddingDictionaryFunctionalTests",
"CR_HeaderBiddingTests",
"CR_HttpTests",
"CR_ImageCacheTests",
"CR_ImpressionDetectionTests",
"CR_InHouseFunctionalTests",
"CR_InHouseFunctionalTests\/test_givenInterstitialLoadWrongBid_whenLoadGoodBid_thenReceiveAd",
"CR_InHouseFunctionalTests\/test_givenInterstitial_whenLoadWrongBid_thenFailToReceiveAd",
"CR_IntegrationRegistryTests",
"CR_IntegrationsTestBase",
"CR_InternalContextProviderTests",
"CR_InternalContextProviderTests\/testFetchInternalUserContext_GivenRealData_PutProperInformation",
"CR_LogHandlerTests",
"CR_LoggingFunctionalTests",
"CR_LoggingTests",
"CR_NativeAdFunctionalTests",
"CR_NativeAdFunctionalTests\/testAdCellFilledWithDataInTableViewWithPreProdContent",
"CR_NativeAdFunctionalTests\/testAdLoadedInTableView",
"CR_NativeAdFunctionalTests\/testGivenNativeAdLoaderNotRetained_whenClickOnAd_thenClickDetected",
Expand All @@ -138,12 +126,6 @@
"CR_NativeAdFunctionalTests\/testGivenNativeAds_whenLoadingAllNativeAd_triggerImpressionForVisibleAd",
"CR_NativeAdFunctionalTests\/testGivenNativeAds_whenScrolling_triggerAllImpression",
"CR_NativeAdFunctionalTests\/testGivenNativeAds_whenTapOnLastOne_thenDetectClick",
"CR_NativeAdvertiserTests",
"CR_NativeAssetsTests",
"CR_NativeImageTests",
"CR_NativePrivacyTests",
"CR_NativeProductTests",
"CR_NetworkManagerTests",
"CR_NetworkManagerTests\/testGetWithoutResponseHandlerDoesNotCrash",
"CR_NetworkManagerTests\/testNetworkManagerFailedSerialization",
"CR_NetworkManagerTests\/testNetworkManagerPostCall",
Expand All @@ -164,7 +146,6 @@
"CR_ProfileIdFunctionalTests\/testStandaloneBanner_GivenAnyPreviousIntegration_UseStandaloneProfileId",
"CR_ProfileIdFunctionalTests\/testStandaloneInterstitial_GivenAnyPreviousIntegration_UseStandaloneProfileId",
"CR_ProfileIdFunctionalTests\/testStandaloneNative_GivenAnyPreviousIntegration_UseStandaloneProfileId",
"CR_RegistrationFunctionalTests",
"CR_RegistrationFunctionalTests\/test_givenCriteoInitWithBanner_whenRegisterTwice_thenOneCBDCall",
"CR_RegistrationFunctionalTests\/test_givenCriteoInitWithInterstitial_whenRegisterTwice_thenOneCBDCall",
"CR_RegistrationFunctionalTests\/test_givenCriteoInitWithNative_whenRegisterTwice_thenOneCBDCall",
Expand All @@ -173,6 +154,7 @@
"CR_RemoteLogRecordSerializerTests",
"CR_RemoteLogRecordTests",
"CR_RemoteLogStorageTests",
"CR_SKAdNetworkImpressionTests",
"CR_SKAdNetworkParametersTests",
"CR_SafeMediaDownloaderTests",
"CR_StandaloneBannerFunctionalTests",
Expand Down
Loading

0 comments on commit 2aa4c42

Please sign in to comment.