From 5fecb3908890dca984af33534ec2169761598d62 Mon Sep 17 00:00:00 2001 From: Martin Cardozo Date: Mon, 29 Sep 2025 10:37:57 -0300 Subject: [PATCH 01/11] Updated to macos latest --- .github/workflows/base_ut.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/base_ut.yaml b/.github/workflows/base_ut.yaml index 8aedeaae8..00464b3a7 100644 --- a/.github/workflows/base_ut.yaml +++ b/.github/workflows/base_ut.yaml @@ -13,7 +13,7 @@ on: jobs: test: - runs-on: [macos-14] + runs-on: [macos-latest] steps: - name: Select Xcode From 7c0b2740a3ccb826947e963c0813ca6c4b70f772 Mon Sep 17 00:00:00 2001 From: Martin Cardozo Date: Mon, 29 Sep 2025 10:42:03 -0300 Subject: [PATCH 02/11] Updating XCode version for GHA --- .github/workflows/base_ut.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/base_ut.yaml b/.github/workflows/base_ut.yaml index 00464b3a7..efc570e5e 100644 --- a/.github/workflows/base_ut.yaml +++ b/.github/workflows/base_ut.yaml @@ -19,7 +19,7 @@ jobs: - name: Select Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: 15.4.0 + xcode-version: 16 - name: Checkout uses: actions/checkout@v4 From 8144646b33ba115f1951b7236e6117b6ac7cbd2c Mon Sep 17 00:00:00 2001 From: Martin Cardozo Date: Mon, 29 Sep 2025 10:54:53 -0300 Subject: [PATCH 03/11] Updating iOS version --- .github/workflows/base_build.yaml | 4 ++-- .github/workflows/sonar.yml | 2 +- .github/workflows/test_all.yaml | 2 +- .github/workflows/xcframework.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/base_build.yaml b/.github/workflows/base_build.yaml index 3ac7a9dae..d3fd0c8e0 100644 --- a/.github/workflows/base_build.yaml +++ b/.github/workflows/base_build.yaml @@ -14,13 +14,13 @@ on: jobs: build: - runs-on: [macos-14] + runs-on: [macos-latest] steps: - name: Select Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: 15.4.0 + xcode-version: 16 - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 95a9fbc4f..f2b4d40e0 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -13,7 +13,7 @@ concurrency: jobs: build-and-collect-coverage: name: Build & Collect Coverage - runs-on: macos-15 + runs-on: macos-latest timeout-minutes: 15 steps: - name: Checkout diff --git a/.github/workflows/test_all.yaml b/.github/workflows/test_all.yaml index 534026ada..b137a2d28 100644 --- a/.github/workflows/test_all.yaml +++ b/.github/workflows/test_all.yaml @@ -36,4 +36,4 @@ jobs: uses: ./.github/workflows/base_ut.yaml with: test-plan: ${{ matrix.plan }} - destination: 'platform=iOS Simulator,OS=17.2,name=iPhone 15' + destination: 'platform=iOS Simulator,OS=18.5,name=iPhone 15' diff --git a/.github/workflows/xcframework.yaml b/.github/workflows/xcframework.yaml index b8076747c..f2457100e 100644 --- a/.github/workflows/xcframework.yaml +++ b/.github/workflows/xcframework.yaml @@ -14,7 +14,7 @@ jobs: - name: Select Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: 15.1.0 + xcode-version: 16 - uses: actions/checkout@v2 - uses: actions/setup-python@v2 From baaa181bd60f6d6a6e7e61b952cab8aec918a7cf Mon Sep 17 00:00:00 2001 From: Martin Cardozo Date: Mon, 29 Sep 2025 11:15:01 -0300 Subject: [PATCH 04/11] Update iPhone version --- .github/workflows/test_all.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_all.yaml b/.github/workflows/test_all.yaml index b137a2d28..0e454056f 100644 --- a/.github/workflows/test_all.yaml +++ b/.github/workflows/test_all.yaml @@ -36,4 +36,4 @@ jobs: uses: ./.github/workflows/base_ut.yaml with: test-plan: ${{ matrix.plan }} - destination: 'platform=iOS Simulator,OS=18.5,name=iPhone 15' + destination: 'platform=iOS Simulator,OS=18.5,name=iPhone 16 Pro Max' From e480099751eebe156eac622eb9b110d0df865d00 Mon Sep 17 00:00:00 2001 From: Martin Cardozo Date: Mon, 29 Sep 2025 14:28:01 -0300 Subject: [PATCH 05/11] Yaml modified --- .github/workflows/sonar.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index f2b4d40e0..716383bae 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -28,7 +28,7 @@ jobs: -project Split.xcodeproj \ -scheme Split \ -testPlan "SplitiOSFull" \ - -destination 'platform=iOS Simulator,OS=18.4,name=iPhone 16' \ + -destination 'platform=iOS Simulator,OS=18.4,name=iPhone 16 Pro Max' \ -enableCodeCoverage YES \ -resultBundlePath build/Logs/Test/TestResults.xcresult \ -derivedDataPath build From 71cdc4f6d590d72947c2d1f0c0cd85acf1b4928c Mon Sep 17 00:00:00 2001 From: Martin Cardozo Date: Wed, 1 Oct 2025 13:14:01 -0300 Subject: [PATCH 06/11] Swift 5.9 --- .github/workflows/base_build.yaml | 1 + .github/workflows/base_ut.yaml | 1 + .github/workflows/test_all.yaml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/base_build.yaml b/.github/workflows/base_build.yaml index d3fd0c8e0..f1ee06b4c 100644 --- a/.github/workflows/base_build.yaml +++ b/.github/workflows/base_build.yaml @@ -37,3 +37,4 @@ jobs: destination: ${{ inputs.destination }} project: Split.xcodeproj scheme: ${{ inputs.scheme }} + build-settings: SWIFT_VERSION=5.9 diff --git a/.github/workflows/base_ut.yaml b/.github/workflows/base_ut.yaml index efc570e5e..e790346b0 100644 --- a/.github/workflows/base_ut.yaml +++ b/.github/workflows/base_ut.yaml @@ -39,6 +39,7 @@ jobs: output-formatter: 'xcbeautify' sdk: 'iphonesimulator' test-plan: ${{ inputs.test-plan }} + build-settings: SWIFT_VERSION=5.9 # - name: Install java 11 # uses: actions/setup-java@v3 diff --git a/.github/workflows/test_all.yaml b/.github/workflows/test_all.yaml index 0e454056f..6c8943d8b 100644 --- a/.github/workflows/test_all.yaml +++ b/.github/workflows/test_all.yaml @@ -37,3 +37,4 @@ jobs: with: test-plan: ${{ matrix.plan }} destination: 'platform=iOS Simulator,OS=18.5,name=iPhone 16 Pro Max' + build-settings: SWIFT_VERSION=5.9 From cc3d6e7137731f2276f93895a3edd359109f8c91 Mon Sep 17 00:00:00 2001 From: Martin Cardozo Date: Wed, 1 Oct 2025 13:19:26 -0300 Subject: [PATCH 07/11] Build settings corrected --- .github/workflows/base_build.yaml | 3 +-- .github/workflows/base_ut.yaml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/base_build.yaml b/.github/workflows/base_build.yaml index f1ee06b4c..3eed5a0a5 100644 --- a/.github/workflows/base_build.yaml +++ b/.github/workflows/base_build.yaml @@ -31,10 +31,9 @@ jobs: uses: sersoft-gmbh/xcodebuild-action@v3 with: action: build - build-settings: ONLY_ACTIVE_ARCH=NO TEST_AFTER_BUILD=NO + build-settings: ONLY_ACTIVE_ARCH=NO TEST_AFTER_BUILD=NO SWIFT_VERSION=5.9 configuration: Debug derived-data-path: "${{ github.workspace }}/SplitApp" destination: ${{ inputs.destination }} project: Split.xcodeproj scheme: ${{ inputs.scheme }} - build-settings: SWIFT_VERSION=5.9 diff --git a/.github/workflows/base_ut.yaml b/.github/workflows/base_ut.yaml index e790346b0..b71660d8a 100644 --- a/.github/workflows/base_ut.yaml +++ b/.github/workflows/base_ut.yaml @@ -30,7 +30,7 @@ jobs: uses: sersoft-gmbh/xcodebuild-action@v3 with: action: test - build-settings: ONLY_ACTIVE_ARCH=NO + build-settings: ONLY_ACTIVE_ARCH=NO SWIFT_VERSION=5.9 configuration: Debug derived-data-path: "${{github.workspace}}/SplitApp" destination: ${{ inputs.destination }} @@ -39,7 +39,6 @@ jobs: output-formatter: 'xcbeautify' sdk: 'iphonesimulator' test-plan: ${{ inputs.test-plan }} - build-settings: SWIFT_VERSION=5.9 # - name: Install java 11 # uses: actions/setup-java@v3 From 152991bbd2fe55afdf121eb4823958e972471865 Mon Sep 17 00:00:00 2001 From: Martin Cardozo Date: Wed, 1 Oct 2025 13:19:49 -0300 Subject: [PATCH 08/11] Build settings corrected --- .github/workflows/test_all.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test_all.yaml b/.github/workflows/test_all.yaml index 6c8943d8b..0e454056f 100644 --- a/.github/workflows/test_all.yaml +++ b/.github/workflows/test_all.yaml @@ -37,4 +37,3 @@ jobs: with: test-plan: ${{ matrix.plan }} destination: 'platform=iOS Simulator,OS=18.5,name=iPhone 16 Pro Max' - build-settings: SWIFT_VERSION=5.9 From ba21a40a22b97d4e25ca67a1d8a379a5d10827bf Mon Sep 17 00:00:00 2001 From: Martin Cardozo Date: Thu, 2 Oct 2025 12:40:55 -0300 Subject: [PATCH 09/11] Changing branch --- .../Service/Telemetry/TelemetryStatsRecorderWorkerTests.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SplitTests/Service/Telemetry/TelemetryStatsRecorderWorkerTests.swift b/SplitTests/Service/Telemetry/TelemetryStatsRecorderWorkerTests.swift index f3f9f5207..39dfea680 100644 --- a/SplitTests/Service/Telemetry/TelemetryStatsRecorderWorkerTests.swift +++ b/SplitTests/Service/Telemetry/TelemetryStatsRecorderWorkerTests.swift @@ -94,6 +94,7 @@ class TelemetryStatsRecorderWorkerTests: XCTestCase { statsRecorder.queue = DispatchQueue(label: "pepe") let queue = DispatchQueue(label: "concurrent-test", attributes: .concurrent) let group = DispatchGroup() + let expectation = self.expectation(description: "Concurrent flush finished") for _ in 0..<6 { group.enter() @@ -110,6 +111,9 @@ class TelemetryStatsRecorderWorkerTests: XCTestCase { XCTAssertEqual(6, self.mySegmentsStorage.getCountCalledCount) XCTAssertEqual(6, self.myLargeSegmentsStorage.getCountCalledCount) XCTAssertEqual(6, self.telemetryStorage.popTagsCallCount) + expectation.fulfill() } + + waitForExpectations(timeout: 5) } } From 7f827733df5af34d9009265126d7c77c289e6d56 Mon Sep 17 00:00:00 2001 From: Martin Cardozo Date: Thu, 20 Nov 2025 14:23:12 -0300 Subject: [PATCH 10/11] Update iOS Simulator destination in workflow --- .github/workflows/test_all.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_all.yaml b/.github/workflows/test_all.yaml index 0e454056f..012280dbd 100644 --- a/.github/workflows/test_all.yaml +++ b/.github/workflows/test_all.yaml @@ -36,4 +36,4 @@ jobs: uses: ./.github/workflows/base_ut.yaml with: test-plan: ${{ matrix.plan }} - destination: 'platform=iOS Simulator,OS=18.5,name=iPhone 16 Pro Max' + destination: 'platform=iOS Simulator,name=iPhone 16,OS=latest' From 5bf9d9191f5d932a8297796d5d70ce03d1269e41 Mon Sep 17 00:00:00 2001 From: Martin Cardozo Date: Thu, 20 Nov 2025 14:37:06 -0300 Subject: [PATCH 11/11] Flaky test fixed --- SplitTests/Fake/Network/TelemetryProducerStub.swift | 4 ++++ SplitTests/Fake/Storage/MySegmentsStorageStub.swift | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/SplitTests/Fake/Network/TelemetryProducerStub.swift b/SplitTests/Fake/Network/TelemetryProducerStub.swift index 1dae5d0a1..8689d01ab 100644 --- a/SplitTests/Fake/Network/TelemetryProducerStub.swift +++ b/SplitTests/Fake/Network/TelemetryProducerStub.swift @@ -28,6 +28,8 @@ class TelemetryStorageStub: TelemetryStorage { var impressions = [TelemetryImpressionsDataType: Int]() var events = [TelemetryEventsDataType: Int]() + var lock = NSLock() + var isFactoryDataRecorded = Atomic(false) func recordLastSync(resource: Resource, time: Int64) { @@ -148,6 +150,8 @@ class TelemetryStorageStub: TelemetryStorage { } func popTags() -> [String] { + lock.lock() + defer { lock.unlock() } popTagsCallCount+=1 return [] } diff --git a/SplitTests/Fake/Storage/MySegmentsStorageStub.swift b/SplitTests/Fake/Storage/MySegmentsStorageStub.swift index 072d466ba..7b5b403f9 100644 --- a/SplitTests/Fake/Storage/MySegmentsStorageStub.swift +++ b/SplitTests/Fake/Storage/MySegmentsStorageStub.swift @@ -20,6 +20,8 @@ class MySegmentsStorageStub: MySegmentsStorage { var getCountByKeyCalledCount = 0 var getCountCalledCount = 0 var changeNumber: Int64 = -1 + + var lock = NSLock() var keys: Set { return Set(segments.keys.map { $0 }) @@ -69,6 +71,8 @@ class MySegmentsStorageStub: MySegmentsStorage { } func getCount() -> Int { + lock.lock() + defer { lock.unlock() } getCountCalledCount+=1 var count = 0 for (_, value) in segments {