Skip to content

Commit 8cd364b

Browse files
MOB-11464: In App Business Critical Integration Tests (#942)
Co-authored-by: Joao Dordio <[email protected]>
1 parent a5a311d commit 8cd364b

20 files changed

+1893
-558
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: BCIT InApp Messaging Integration Test
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, labeled]
6+
workflow_dispatch:
7+
inputs:
8+
ref:
9+
description: 'Branch or commit to test (leave empty for current branch)'
10+
required: false
11+
type: string
12+
13+
jobs:
14+
inapp-messaging-test:
15+
name: BCIT InApp Messaging Integration Test
16+
runs-on: macos-latest
17+
timeout-minutes: 30
18+
env:
19+
XCODE_VERSION: '16.4'
20+
if: >
21+
github.event_name == 'workflow_dispatch' ||
22+
(
23+
github.event_name == 'pull_request' && (
24+
contains(github.event.pull_request.labels.*.name, 'bcit') ||
25+
contains(github.event.pull_request.labels.*.name, 'BCIT') ||
26+
contains(github.event.pull_request.labels.*.name, 'bcit-inapp') ||
27+
contains(github.event.pull_request.labels.*.name, 'BCIT-INAPP') ||
28+
contains(github.event.pull_request.labels.*.name, 'Bcit') ||
29+
contains(github.event.pull_request.labels.*.name, 'Bcit-Inapp') ||
30+
startsWith(github.event.pull_request.head.ref, 'release/')
31+
)
32+
)
33+
34+
steps:
35+
- name: Checkout Repository
36+
uses: actions/checkout@v4
37+
with:
38+
ref: ${{ github.event.inputs.ref || github.ref }}
39+
40+
- name: Setup Xcode
41+
uses: maxim-lobanov/setup-xcode@v1
42+
with:
43+
xcode-version: ${{ env.XCODE_VERSION }}
44+
45+
- name: Validate Xcode Version
46+
run: |
47+
echo "🔍 Validating Xcode version and environment..."
48+
echo "DEVELOPER_DIR: $DEVELOPER_DIR"
49+
50+
# Check xcodebuild version
51+
echo "🔍 Checking xcodebuild version..."
52+
ACTUAL_XCODE_VERSION=$(xcodebuild -version | head -n 1 | awk '{print $2}')
53+
echo "Xcode version: $ACTUAL_XCODE_VERSION"
54+
echo "Expected version: $XCODE_VERSION"
55+
56+
# Check xcodebuild path
57+
XCODEBUILD_PATH=$(which xcodebuild)
58+
echo "xcodebuild path: $XCODEBUILD_PATH"
59+
60+
# Verify we're using the correct Xcode version
61+
if echo "$ACTUAL_XCODE_VERSION" | grep -q "$XCODE_VERSION"; then
62+
echo "✅ Using correct Xcode version: $ACTUAL_XCODE_VERSION"
63+
else
64+
echo "❌ Incorrect Xcode version!"
65+
echo "Current: $ACTUAL_XCODE_VERSION"
66+
echo "Expected: $XCODE_VERSION"
67+
exit 1
68+
fi
69+
70+
- name: Setup Local Environment
71+
working-directory: tests/business-critical-integration
72+
run: |
73+
echo "🚀 Setting up local environment for integration tests..."
74+
75+
# Run setup script with parameters from repository secrets
76+
./scripts/setup-local-environment.sh \
77+
"${{ secrets.BCIT_TEST_PROJECT_ID }}" \
78+
"${{ secrets.BCIT_ITERABLE_SERVER_KEY }}" \
79+
"${{ secrets.BCIT_ITERABLE_API_KEY }}"
80+
81+
- name: Validate Setup
82+
working-directory: tests/business-critical-integration
83+
run: |
84+
echo "🔍 Validating environment setup..."
85+
./scripts/validate-setup.sh
86+
87+
- name: Run In App Messaging Tests
88+
working-directory: tests/business-critical-integration
89+
run: |
90+
echo "🧪 Running in app integration tests..."
91+
./scripts/run-tests.sh inapp
92+
93+
- name: Upload Test Results
94+
if: always()
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: inapp-messaging-test-results
98+
path: |
99+
tests/business-critical-integration/reports/
100+
tests/business-critical-integration/screenshots/
101+
tests/business-critical-integration/logs/
102+
retention-days: 7

.github/workflows/bcit-integration-test-push-notification.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ on:
1010
required: false
1111
type: string
1212

13-
env:
14-
DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer
15-
1613
jobs:
1714
push-notification-test:
1815
name: BCIT Push Notification Integration Test
1916
runs-on: macos-latest
2017
timeout-minutes: 30
18+
env:
19+
XCODE_VERSION: '16.4'
2120
if: >
2221
github.event_name == 'workflow_dispatch' ||
2322
(
@@ -41,39 +40,30 @@ jobs:
4140
- name: Setup Xcode
4241
uses: maxim-lobanov/setup-xcode@v1
4342
with:
44-
xcode-version: '16.4'
43+
xcode-version: ${{ env.XCODE_VERSION }}
4544

4645
- name: Validate Xcode Version
4746
run: |
4847
echo "🔍 Validating Xcode version and environment..."
4948
echo "DEVELOPER_DIR: $DEVELOPER_DIR"
50-
echo "Expected Xcode path: /Applications/Xcode_16.2.app/Contents/Developer"
51-
52-
# Check if DEVELOPER_DIR points to the right Xcode
53-
if [[ "$DEVELOPER_DIR" == "/Applications/Xcode_16.2.app/Contents/Developer" ]]; then
54-
echo "✅ DEVELOPER_DIR is correctly set"
55-
else
56-
echo "❌ DEVELOPER_DIR mismatch!"
57-
echo "Current: $DEVELOPER_DIR"
58-
echo "Expected: /Applications/Xcode_16.2.app/Contents/Developer"
59-
fi
6049
6150
# Check xcodebuild version
6251
echo "🔍 Checking xcodebuild version..."
63-
XCODE_VERSION=$(xcodebuild -version | head -n 1)
64-
echo "Xcode version: $XCODE_VERSION"
52+
ACTUAL_XCODE_VERSION=$(xcodebuild -version | head -n 1 | awk '{print $2}')
53+
echo "Xcode version: $ACTUAL_XCODE_VERSION"
54+
echo "Expected version: $XCODE_VERSION"
6555
6656
# Check xcodebuild path
6757
XCODEBUILD_PATH=$(which xcodebuild)
6858
echo "xcodebuild path: $XCODEBUILD_PATH"
6959
70-
# Verify we're using Xcode 16.2
71-
if echo "$XCODE_VERSION" | grep -q "16.2"; then
72-
echo "✅ Using correct Xcode version: $XCODE_VERSION"
60+
# Verify we're using the correct Xcode version
61+
if echo "$ACTUAL_XCODE_VERSION" | grep -q "$XCODE_VERSION"; then
62+
echo "✅ Using correct Xcode version: $ACTUAL_XCODE_VERSION"
7363
else
7464
echo "❌ Incorrect Xcode version!"
75-
echo "Current: $XCODE_VERSION"
76-
echo "Expected: Xcode 16.2"
65+
echo "Current: $ACTUAL_XCODE_VERSION"
66+
echo "Expected: $XCODE_VERSION"
7767
exit 1
7868
fi
7969

tests/business-critical-integration/integration-test-app/IterableSDK-Integration-Tester.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
8A24D3B12E4508F400B53850 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
3636
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
3737
membershipExceptions = (
38+
Tests/EmbeddedMessageIntegrationTests.swift,
39+
Tests/InAppMessageIntegrationTests.swift,
3840
Tests/IntegrationTestBase.swift,
3941
Tests/PushNotificationIntegrationTests.swift,
4042
Tests/Utilities/CampaignManager.swift,
@@ -49,9 +51,9 @@
4951
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
5052
membershipExceptions = (
5153
SupportingFiles/Info.plist,
54+
Tests/EmbeddedMessageIntegrationTests.swift,
55+
Tests/InAppMessageIntegrationTests.swift,
5256
Tests/Incomplete/DeepLinkingIntegrationTests.swift,
53-
Tests/Incomplete/EmbeddedMessageIntegrationTests.swift,
54-
Tests/Incomplete/InAppMessageIntegrationTests.swift,
5557
Tests/IntegrationTestBase.swift,
5658
Tests/PushNotificationIntegrationTests.swift,
5759
Tests/Utilities/CampaignManager.swift,

0 commit comments

Comments
 (0)