-
-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
100 additions
and
2 deletions.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
.github/workflows/integration-tests-ui-firebase-test-lab.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: 'Integration Tests (Firebase Test Lab)' | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: Ui tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
||
# we copy the secret to the env variable in order to access it in the workflow | ||
env: | ||
# The contents of service_account.json encoded using base64, to avoid any shell escaping issues | ||
# base64 -i <file>.json | ||
FIREBASE_TEST_LAB_SERVICE_ACCOUNT_JSON_BASE64: ${{ secrets.FIREBASE_TEST_LAB_SERVICE_ACCOUNT_JSON_BASE64 }} | ||
|
||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: 'Set up Java: 17' | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@707359876a764dbcdb9da0b0ed08291818310c3d # pin@v3 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
- name: Make assembleUiTests | ||
run: make assembleUiTests | ||
|
||
- name: 'Install jq' | ||
run: 'sudo apt install -y --no-install-recommends jq' | ||
|
||
- name: Install gcloud | ||
uses: 'google-github-actions/setup-gcloud@v2' | ||
with: | ||
version: '>= 363.0.0' | ||
|
||
- name: Configure gcloud | ||
run: | | ||
echo "$FIREBASE_TEST_LAB_SERVICE_ACCOUNT_JSON_BASE64" | base64 -d | gcloud auth activate-service-account --key-file=- | ||
project_id=$(echo "$FIREBASE_TEST_LAB_SERVICE_ACCOUNT_JSON_BASE64" | base64 -d | jq -r ".project_id") | ||
gcloud config set project $project_id | ||
- name: Firebase Test Lab | ||
run: | | ||
app_apk=./sentry-android-integration-tests/sentry-uitest-android/build/outputs/apk/release/sentry-uitest-android-release.apk | ||
test_app_apk=./sentry-android-integration-tests/sentry-uitest-android/build/outputs/apk/androidTest/release/sentry-uitest-android-release-androidTest.apk | ||
attempts=4 | ||
type=instrumentation | ||
gcloud firebase test android run \ | ||
--app=$app_apk --test=$test_app_apk \ | ||
--type=$type \ | ||
--num-flaky-test-attempts=$attempts \ | ||
--device=^:^model=MediumPhone.arm:version=34 \ | ||
--device=^:^model=bluejay:version=32 \ | ||
--device=^:^model=a14xm:version=34 | ||
status=$? | ||
if [ $status -ne 0 ]; then | ||
echo "Firebase Test Lab failed with status $status" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
sentry-android-integration-tests/sentry-uitest-android/src/androidTest/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
<!-- WRITE_EXTERNAL_STORAGE is not needed on Android 10 (API level 29) or higher. --> | ||
|
||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
|
||
<instrumentation | ||
android:name="androidx.test.runner.AndroidJUnitRunner" | ||
android:targetPackage="io.sentry.uitest.android"> | ||
|
||
<meta-data | ||
android:name="screenCaptureProcessors" | ||
android:value="com.google.firebase.testlab.screenshot.FirebaseScreenCaptureProcessor" /> | ||
</instrumentation> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters