Skip to content

Commit dfec313

Browse files
authored
Merge branch 'blackout/Phase-1' into chore/replace-cpp-bracket-code
2 parents eac86b9 + 35f706b commit dfec313

26 files changed

+455
-52
lines changed

.github/workflows/build-and-lint.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: iOS SDK Build and Lint
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
45

56
concurrency:
67
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

.github/workflows/build-secondary-platforms.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: Secondary Platforms iOS Build
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
8+
cancel-in-progress: true
49

510
env:
611
XCODE_VERSION: "16.4"
@@ -15,8 +20,21 @@ jobs:
1520
- name: Checkout
1621
uses: actions/checkout@v5
1722

18-
- name: Select Xcode
19-
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
23+
- name: Set up Xcode
24+
uses: maxim-lobanov/setup-xcode@v1
25+
with:
26+
xcode-version: ${{ env.XCODE_VERSION }}
27+
28+
- name: Setup specified simulator
29+
uses: futureware-tech/simulator-action@v4
30+
id: simulator
31+
with:
32+
model: iPhone 16 Pro
33+
os: iOS
34+
os_version: '>=18.0'
35+
erase_before_boot: true
36+
wait_for_boot: true
37+
shutdown_after_job: true
2038

2139
- name: Add React Native cli
2240
run: yarn add -D @react-native-community/cli
@@ -28,4 +46,4 @@ jobs:
2846
run: pod install
2947

3048
- name: Build iOS extension scheme
31-
run: xcodebuild -allowProvisioningUpdates -workspace RNExample.xcworkspace -scheme RNExample -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=latest'
49+
run: xcodebuild -allowProvisioningUpdates -workspace RNExample.xcworkspace -scheme RNExample -destination 'id=${{ steps.simulator.outputs.UDID }}'

.github/workflows/cross-platform-tests.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
name: Cross Platform Tests
22

33
on:
4-
# Run for all PRs
54
pull_request:
6-
# Run again once merged into development branch
7-
push:
8-
branches:
9-
- development
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
8+
cancel-in-progress: true
109

1110
env:
1211
XCODE_VERSION: "16.4"
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Integration Tests
2+
3+
on:
4+
# Run for all PRs
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
14+
env:
15+
XCODE_VERSION: "16.4"
16+
WORKING_DIRECTORY: IntegrationTests
17+
WIREMOCK_VERSION: "3.9.1"
18+
19+
jobs:
20+
integration-tests:
21+
name: iOS Integration Tests
22+
runs-on: macos-15
23+
timeout-minutes: 30
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v5
28+
29+
- name: Select Xcode
30+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
31+
32+
- name: Install Tuist
33+
run: brew install tuist
34+
35+
- name: Setup Java
36+
uses: actions/setup-java@v4
37+
with:
38+
distribution: 'temurin'
39+
java-version: '17'
40+
41+
- name: Download WireMock standalone
42+
run: |
43+
curl -L -o wiremock.jar \
44+
"https://repo1.maven.org/maven2/org/wiremock/wiremock-standalone/${{ env.WIREMOCK_VERSION }}/wiremock-standalone-${{ env.WIREMOCK_VERSION }}.jar"
45+
echo "✅ WireMock downloaded"
46+
47+
- name: Run Integration Tests
48+
id: integration_tests
49+
working-directory: ${{ env.WORKING_DIRECTORY }}
50+
env:
51+
CI: "true"
52+
WIREMOCK_JAR: ${{ github.workspace }}/wiremock.jar
53+
run: |
54+
# Make scripts executable
55+
chmod +x run_clean_integration_tests.sh common.sh run_integration_tests_ci.sh
56+
57+
# Run the CI-specific verification script
58+
./run_integration_tests_ci.sh
59+
60+
- name: Collect WireMock logs on failure
61+
if: failure()
62+
working-directory: ${{ env.WORKING_DIRECTORY }}
63+
run: |
64+
echo "📋 Collecting WireMock logs..."
65+
mkdir -p artifacts
66+
67+
# Collect WireMock log file if exists
68+
if [ -f "wiremock.log" ]; then
69+
cp wiremock.log artifacts/wiremock-logs.txt || true
70+
fi
71+
72+
# Get unmatched requests
73+
curl -s http://localhost:8080/__admin/requests/unmatched > artifacts/unmatched-requests.json 2>/dev/null || true
74+
75+
# Get all requests
76+
curl -s http://localhost:8080/__admin/requests > artifacts/all-requests.json 2>/dev/null || true
77+
78+
echo "✅ Logs collected"
79+
80+
- name: Collect test artifacts on failure
81+
if: failure()
82+
working-directory: ${{ env.WORKING_DIRECTORY }}
83+
run: |
84+
echo "📋 Collecting test artifacts..."
85+
mkdir -p artifacts
86+
87+
# Copy WireMock mappings for debugging
88+
if [ -d "wiremock-recordings/mappings" ]; then
89+
cp -r wiremock-recordings/mappings artifacts/mappings || true
90+
fi
91+
92+
# Collect simulator logs
93+
DEVICE_ID=$(xcrun simctl list devices | grep "iPhone" | grep "Booted" | head -1 | awk -F '[()]' '{print $2}')
94+
if [ -n "$DEVICE_ID" ]; then
95+
xcrun simctl spawn "$DEVICE_ID" log show --predicate 'subsystem == "com.mparticle"' --last 10m > artifacts/simulator-logs.txt 2>/dev/null || true
96+
fi
97+
98+
echo "✅ Artifacts collected"
99+
100+
- name: Upload artifacts on failure
101+
if: failure()
102+
uses: actions/upload-artifact@v4
103+
with:
104+
name: integration-test-artifacts
105+
path: ${{ env.WORKING_DIRECTORY }}/artifacts/
106+
retention-days: 7
107+
if-no-files-found: ignore

.github/workflows/native-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: Xcode Tests
22

33
on:
4-
# Run for all PRs
54
pull_request:
6-
# Run again once merged into development branch
7-
push:
8-
branches:
9-
- development
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
8+
cancel-in-progress: true
109

1110
env:
1211
XCODE_VERSION: "16.4"
1312

1413
jobs:
1514
native-unit-tests:
15+
timeout-minutes: 15
1616
strategy:
1717
fail-fast: false
1818
max-parallel: 4

IntegrationTests/Sources/main.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ func testIncrementSessionAttribute(mparticle: MParticle, uploadWaiter: EventUplo
283283
// Start a new session since the previous test ended the session
284284
mparticle.beginSession()
285285

286-
// Allow time for session to be created
287-
sleep(1)
286+
// Wait for session start to be uploaded (ensures separate request from session end)
287+
uploadWaiter.wait()
288288

289289
// First set an initial numeric value for the session attribute
290290
mparticle.setSessionAttribute("Song Count", value: 5)

IntegrationTests/common.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,13 @@ find_device() {
120120
start_simulator() {
121121
echo "📱 Starting simulator $DEVICE_NAME..."
122122
xcrun simctl boot "$DEVICE_ID" || true
123-
open -a Simulator
123+
124+
# Only open Simulator GUI if not running in CI (headless mode)
125+
if [ -z "$CI" ]; then
126+
open -a Simulator
127+
else
128+
echo "ℹ️ Running in CI mode - skipping Simulator GUI"
129+
fi
124130

125131
echo "⏳ Waiting for simulator to start..."
126132
xcrun simctl bootstatus "$DEVICE_ID" -b

0 commit comments

Comments
 (0)