Skip to content

Commit 9a9238b

Browse files
authored
chore: Add integration tests for Android (#1146)
* Update sample app to receive input args on Android (required for testing) * Add Android integration tests to CI * Comment crash capturing test * Fix test script * Fix minor issues * Rename vars * Clean up * Better comments * Refactor * Fix workflow * Fix * Simplify mechanism to pass input args to Android app * Clean up comments * Test SauceLabs Fix artifact download Shell Fix Fix Fix Fix Set config Fix syntax Sauce skip run Update appium Test test test apk name Test Test Test Test Test Test Test Test Test Test Test tets Test Test Poll session status Test Test Test 2 runs Test Test Try fix redirect Test Test fix id Test app status poll Test Clean up * Add separate SauceLabs test script * Fix log retrieval * Fix * Rename script for running Android integration tests locally * Update readme * Revert CI tweaks for faster iterations * Clean up * Fix * Fix typo * Limit android e2e tests to 2 parallel jobs * Remove Pester install step as it is redundant * Rename test scripts * Clean up * Rework SauceLabs API requests * Simplify logs retrieval * Remove unnecessary quotes * Configure new SauceLabs credentials * Change test device * Change SauceLabs test job name title * Fix android test results upload check * Make SauceLabs device name configurable * Fix sample app * Try using app-runner Android providers for running tests * Fix param name * Pass device name to SauceLabs provider * Connect to SauceLabs device set in env var * Bump app-runner * Merge android test scripts * Remove platform-specific test scripts * Add SauceLabs session name override * Bump app-runner * Fix Android crash capturing test * Fix newline at end of integration-test-android.yml * Clean up comments related to crash capture tests Removed TODO and notes regarding crash capture tests due to Android SDK tag persistence issues. * Update app-runner GIT_TAG to latest version * Update Android test script * Update tests invocation * Fix variable declarations in test script
1 parent cedb74c commit 9a9238b

File tree

11 files changed

+483
-27
lines changed

11 files changed

+483
-27
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,16 @@ jobs:
198198
uses: ./.github/workflows/integration-test-windows.yml
199199
with:
200200
unreal-version: ${{ matrix.unreal }}
201+
202+
integration-test-android:
203+
needs: [test-android]
204+
name: Android UE ${{ matrix.unreal }}
205+
secrets: inherit
206+
strategy:
207+
fail-fast: false
208+
max-parallel: 1
209+
matrix:
210+
unreal: ['5.4', '5.5', '5.6', '5.7']
211+
uses: ./.github/workflows/integration-test-android.yml
212+
with:
213+
unreal-version: ${{ matrix.unreal }}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
unreal-version:
5+
required: true
6+
type: string
7+
8+
jobs:
9+
integration-test:
10+
name: Integration Test
11+
runs-on: ubuntu-latest
12+
13+
env:
14+
GITHUB_TOKEN: ${{ github.token }}
15+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
16+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
17+
SAUCE_REGION: us-west-1
18+
SAUCE_DEVICE_NAME: Samsung_Galaxy_S23_15_real_sjc1
19+
SAUCE_SESSION_NAME: UE ${{ inputs.unreal-version }} Android Integration Test
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
submodules: recursive
25+
26+
- name: Download sample build
27+
uses: actions/download-artifact@v4
28+
with:
29+
name: UE ${{ inputs.unreal-version }} sample build (Android)
30+
path: sample-build
31+
32+
- name: Run integration tests
33+
id: run-integration-tests
34+
shell: pwsh
35+
working-directory: integration-test
36+
env:
37+
SENTRY_UNREAL_TEST_DSN: ${{ secrets.SENTRY_UNREAL_TEST_DSN }}
38+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_API_TOKEN }}
39+
SENTRY_UNREAL_TEST_APP_PATH: ${{ github.workspace }}/sample-build/SentryPlayground-arm64.apk
40+
run: |
41+
cmake -B build -S .
42+
Invoke-Pester Integration.Android.Tests.ps1 -CI
43+
44+
- name: Upload integration test output
45+
if: ${{ always() && steps.run-integration-tests.outcome == 'failure' }}
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: UE ${{ inputs.unreal-version }} integration test output (Android)
49+
path: |
50+
integration-test/output/
51+
retention-days: 14
52+

.github/workflows/integration-test-linux.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,15 @@ jobs:
2626
chmod +x ${{ github.workspace }}/sample-build/SentryPlayground.sh
2727
chmod +x ${{ github.workspace }}/sample-build/SentryPlayground/Plugins/sentry/Binaries/Linux/crashpad_handler
2828
29-
- name: Install Pester
30-
shell: pwsh
31-
run: |
32-
Install-Module -Name Pester -Force -SkipPublisherCheck
33-
3429
- name: Run integration tests
3530
id: run-integration-tests
3631
shell: pwsh
32+
working-directory: integration-test
3733
env:
3834
SENTRY_UNREAL_TEST_DSN: ${{ secrets.SENTRY_UNREAL_TEST_DSN }}
3935
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_API_TOKEN }}
4036
SENTRY_UNREAL_TEST_APP_PATH: ${{ github.workspace }}/sample-build/SentryPlayground.sh
4137
run: |
42-
cd integration-test
43-
mkdir build
4438
cmake -B build -S .
4539
Invoke-Pester Integration.Tests.ps1 -CI
4640

.github/workflows/integration-test-windows.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ jobs:
3030

3131
- name: Run integration tests
3232
id: run-integration-tests
33+
working-directory: integration-test
3334
env:
3435
SENTRY_UNREAL_TEST_DSN: ${{ secrets.SENTRY_UNREAL_TEST_DSN }}
3536
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_API_TOKEN }}
3637
SENTRY_UNREAL_TEST_APP_PATH: ${{ github.workspace }}/sample-build/SentryPlayground.exe
3738
run: |
38-
cd integration-test
39-
mkdir build
4039
cmake -B build -S .
4140
Invoke-Pester Integration.Tests.ps1 -CI
4241

integration-test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include(FetchContent)
77
FetchContent_Declare(
88
app-runner
99
GIT_REPOSITORY https://github.com/getsentry/app-runner.git
10-
GIT_TAG 503795f0ef0f8340fcc0f0bc5fb5437df8cff9ef
10+
GIT_TAG 2f5268c4c27d435417cdf1dadc8980126b9bd64f
1111
)
1212

1313
FetchContent_MakeAvailable(app-runner)

0 commit comments

Comments
 (0)