Skip to content
Merged
6 changes: 3 additions & 3 deletions .github/workflows/base_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,7 +31,7 @@ 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 }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/base_ut.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ on:

jobs:
test:
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
Expand All @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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,name=iPhone 16,OS=latest'
2 changes: 1 addition & 1 deletion .github/workflows/xcframework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions SplitTests/Fake/Network/TelemetryProducerStub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class TelemetryStorageStub: TelemetryStorage {
var impressions = [TelemetryImpressionsDataType: Int]()
var events = [TelemetryEventsDataType: Int]()

var lock = NSLock()

var isFactoryDataRecorded = Atomic<Bool>(false)

func recordLastSync(resource: Resource, time: Int64) {
Expand Down Expand Up @@ -148,6 +150,8 @@ class TelemetryStorageStub: TelemetryStorage {
}

func popTags() -> [String] {
lock.lock()
defer { lock.unlock() }
popTagsCallCount+=1
return []
}
Expand Down
4 changes: 4 additions & 0 deletions SplitTests/Fake/Storage/MySegmentsStorageStub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class MySegmentsStorageStub: MySegmentsStorage {
var getCountByKeyCalledCount = 0
var getCountCalledCount = 0
var changeNumber: Int64 = -1

var lock = NSLock()

var keys: Set<String> {
return Set(segments.keys.map { $0 })
Expand Down Expand Up @@ -69,6 +71,8 @@ class MySegmentsStorageStub: MySegmentsStorage {
}

func getCount() -> Int {
lock.lock()
defer { lock.unlock() }
getCountCalledCount+=1
var count = 0
for (_, value) in segments {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
}
}
Loading