Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
efb0a53
Add script
sumeruchat Oct 16, 2025
0ab1f67
Further fix
sumeruchat Oct 16, 2025
439bd78
Further fix
sumeruchat Oct 16, 2025
b22842b
Further fix
sumeruchat Oct 16, 2025
c9e5aee
Further fix
sumeruchat Oct 16, 2025
692f5b6
Further fix
sumeruchat Oct 16, 2025
d4a6dba
Further fix
sumeruchat Oct 16, 2025
31b07aa
Further fix
sumeruchat Oct 16, 2025
7d22b92
Further fix
sumeruchat Oct 16, 2025
5e56825
Further fix
sumeruchat Oct 16, 2025
f779058
Further fix
sumeruchat Oct 16, 2025
92a59b6
Further fix
sumeruchat Oct 16, 2025
d6118c6
Further fix
sumeruchat Oct 16, 2025
51e1175
Further fix
sumeruchat Oct 16, 2025
4c9d5c6
Further fix
sumeruchat Oct 16, 2025
66d966c
Further fix
sumeruchat Oct 16, 2025
b022027
Further fix
sumeruchat Oct 16, 2025
7aab931
Further fix
sumeruchat Oct 16, 2025
5d5f740
Further fix
sumeruchat Oct 16, 2025
bda103b
Further fix
sumeruchat Oct 16, 2025
3ecdc17
Further fix
sumeruchat Oct 16, 2025
825f86e
Further fix
sumeruchat Oct 16, 2025
cf0b48e
Further fix
sumeruchat Oct 16, 2025
2c61542
Further fix
sumeruchat Oct 16, 2025
57bf6b2
Further fix
sumeruchat Oct 20, 2025
f35b8db
Further fix
sumeruchat Oct 20, 2025
287de38
Further fix
sumeruchat Oct 20, 2025
b52f8dd
Further fix
sumeruchat Oct 20, 2025
707f8cc
Further fix
sumeruchat Oct 21, 2025
467d985
Further fix
sumeruchat Oct 21, 2025
f970608
Further fix
sumeruchat Oct 21, 2025
a84bb1e
Further fix
sumeruchat Oct 21, 2025
fb35d93
Fixes
sumeruchat Oct 21, 2025
cde3021
Further fix
sumeruchat Oct 21, 2025
00abc7c
Further fix
sumeruchat Oct 21, 2025
6184201
Further fix
sumeruchat Oct 21, 2025
5ef389c
Further fix
sumeruchat Oct 21, 2025
61ac9f5
Further fix
sumeruchat Oct 21, 2025
1b1dcdf
Further fix
sumeruchat Oct 21, 2025
6bff398
Further fix
sumeruchat Oct 21, 2025
0352dd9
Further fix
sumeruchat Oct 21, 2025
180402c
Further fix
sumeruchat Oct 21, 2025
75b53b3
Further fix
sumeruchat Oct 21, 2025
1b00571
Further fix
sumeruchat Oct 21, 2025
0b95cd6
Further fix
sumeruchat Oct 21, 2025
45a21e0
Further fix
sumeruchat Oct 21, 2025
b94f762
Further fix
sumeruchat Oct 21, 2025
a549ffe
Further fix
sumeruchat Oct 21, 2025
b8c3461
Further fix
sumeruchat Oct 22, 2025
8ea11df
Further fix
sumeruchat Oct 22, 2025
bd5b4ed
Further fix
sumeruchat Oct 22, 2025
39ad226
Further fix
sumeruchat Oct 22, 2025
de907b7
Further fix
sumeruchat Oct 22, 2025
b00ea85
Further fix
sumeruchat Oct 22, 2025
0cbbd97
Further fix
sumeruchat Oct 22, 2025
9cd0c70
Merge branch 'InApp-Display-E2E' into InApp-Display-E2E-Runner-Script
sumeruchat Oct 23, 2025
3866110
Further fix
sumeruchat Oct 23, 2025
eeb5251
Fixes
sumeruchat Oct 23, 2025
b46369c
Fixes
sumeruchat Oct 23, 2025
51e3b95
Further fix
sumeruchat Oct 23, 2025
1a4561d
Fixes
sumeruchat Oct 23, 2025
51a74c9
Further fix
sumeruchat Oct 23, 2025
384d7be
Further fix
sumeruchat Oct 23, 2025
0af5fd6
Further fix
sumeruchat Oct 23, 2025
e2dc044
Further fix
sumeruchat Oct 23, 2025
40685fb
Further fix
sumeruchat Oct 23, 2025
ee6f977
Fixes
sumeruchat Oct 24, 2025
3466655
Merge branch 'master' into InApp-Display-E2E-Runner-Script
Ayyanchira Oct 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 81 additions & 71 deletions .github/workflows/inapp-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ on:
branches: [ InApp-Display-E2E ]
pull_request:
branches: [ InApp-Display-E2E, master, develop ]
workflow_dispatch: # Allow manual triggering
workflow_dispatch:
inputs:
use-cached-apks:
description: 'Use cached APKs to speed up builds'
required: false
type: boolean
default: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
inapp-e2e-tests:
Expand All @@ -25,107 +35,107 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Set up Android SDK
uses: android-actions/setup-android@v2

uses: android-actions/setup-android@v3
- name: Create local.properties
run: |
echo "sdk.dir=$ANDROID_SDK_ROOT" > local.properties
echo "ndk.dir=$ANDROID_SDK_ROOT/ndk" >> local.properties

- name: Accept Android SDK Licenses
run: |
echo "Accepting Android SDK licenses..."
yes | sdkmanager --licenses || true
echo "SDK licenses accepted"

- name: Setup Google Services Configuration
run: |
echo "Setting up Google Services configuration for CI..."
# Ensure the google-services.json file exists for the build
if [ ! -f "integration-tests/google-services.json" ]; then
echo "Creating google-services.json from template..."
cp integration-tests/google-services.json.template integration-tests/google-services.json
fi
echo "Google Services configuration ready"

- name: Cache Gradle packages
uses: actions/cache@v3
- name: Restore Build Cache
id: build-cache
uses: actions/cache/restore@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
~/.gradle/caches
integration-tests/build/outputs/apk/
app/build/outputs/apk/
iterableapi/build/outputs/aar/
key: build-cache-${{ runner.os }}-${{ hashFiles('**/gradle-wrapper.properties', '**/*.kt', '**/*.java', '**/build.gradle', 'gradle.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Pre-download Gradle and Build (Parallel with Emulator)
build-cache-${{ runner.os }}-

- name: Build Test APKs
run: |
echo "Pre-downloading Gradle and building while emulator boots..."
# Download Gradle wrapper in background
./gradlew --version &
# Start building APKs in background
./gradlew :integration-tests:assembleDebug :integration-tests:assembleDebugAndroidTest --no-daemon &
echo "Build started in background..."
echo "Building test APKs..."
./gradlew :integration-tests:assembleDebug :integration-tests:assembleDebugAndroidTest --no-daemon

- name: Save Build Cache
uses: actions/cache/save@v3
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
integration-tests/build/outputs/apk/
app/build/outputs/apk/
iterableapi/build/outputs/aar/
key: build-cache-${{ runner.os }}-${{ hashFiles('**/gradle-wrapper.properties', '**/*.kt', '**/*.java', '**/build.gradle', 'gradle.properties') }}

- name: Restore AVD Cache
uses: actions/cache/restore@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-reactivecircus-${{ matrix.api-level }}

- name: Create AVD Snapshot
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: google_apis
arch: x86_64
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none -dns-server 8.8.8.8 -netdelay none -netspeed full
disable-animations: false
script: echo "AVD snapshot created for caching"

- name: Save AVD Cache
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-reactivecircus-${{ matrix.api-level }}

- name: Run UI Tests with Emulator (Intel / x86_64)
uses: ReactiveCircus/android-emulator-runner@v2
- name: Run In-App Message E2E Test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: google_apis
arch: x86_64
profile: pixel_6
cores: 2
ram-size: 3072M
heap-size: 576M
force-avd-creation: true
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none -dns-server 8.8.8.8 -netdelay none -netspeed full
disable-animations: true
emulator-boot-timeout: 900
emulator-options: -no-window -no-snapshot -gpu swiftshader_indirect -no-boot-anim -camera-back none -partition-size 6000
pre-emulator-launch-script: |
# Clean + start adb after platform-tools exist (avoids tcp:5037 noise)
adb kill-server >/dev/null 2>&1 || true
adb start-server
script: |
echo "Emulator is ready! Running tests..."
echo "Setting up permissions..."
adb shell pm grant com.iterable.integration.tests android.permission.POST_NOTIFICATIONS
adb shell pm grant com.iterable.integration.tests android.permission.INTERNET
adb shell pm grant com.iterable.integration.tests android.permission.ACCESS_NETWORK_STATE
adb shell pm grant com.iterable.integration.tests android.permission.WAKE_LOCK

echo "Running In-App Message MVP test..."
echo "Debug: Checking if APKs are ready..."
ls -la integration-tests/build/outputs/apk/ || echo "APK directory not found"

echo "Debug: Verifying API keys are set..."
echo "ITERABLE_API_KEY length: ${#ITERABLE_API_KEY}"
echo "ITERABLE_SERVER_API_KEY length: ${#ITERABLE_SERVER_API_KEY}"
echo "ITERABLE_TEST_USER_EMAIL: $ITERABLE_TEST_USER_EMAIL"

# Start logcat in background for crash debugging
adb logcat > /tmp/test-logcat.log &
LOGCAT_PID=$!

# Run the specific test with better error handling
./gradlew :integration-tests:connectedDebugAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.class=com.iterable.integration.tests.InAppMessageIntegrationTest#testInAppMessageMVP \
--stacktrace --no-daemon || {
echo "Test failed! Collecting crash logs..."
kill $LOGCAT_PID 2>/dev/null || true
echo "=== CRASH LOGS ==="
tail -100 /tmp/test-logcat.log
echo "=== END CRASH LOGS ==="
exit 1
}

# Stop logcat
kill $LOGCAT_PID 2>/dev/null || true
script: ./integration-tests/run_tests_ci.sh com.iterable.integration.tests.InAppMessageIntegrationTest testInAppMessageMVP
env:
ITERABLE_API_KEY: ${{ secrets.BCIT_ITERABLE_API_KEY }}
ITERABLE_SERVER_API_KEY: ${{ secrets.BCIT_ITERABLE_SERVER_API_KEY }}
ITERABLE_TEST_USER_EMAIL: ${{ secrets.BCIT_ITERABLE_TEST_USER_EMAIL }}

- name: Upload Test Screenshots and Recording
if: always()
uses: actions/upload-artifact@v4
with:
name: test-screenshots-api-${{ matrix.api-level }}
path: /tmp/test-screenshots/
retention-days: 7

# - name: Generate Test Report
# if: always()
Expand Down
Loading
Loading