-
-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use Firebase Test Lab (PoC) #3929
base: main
Are you sure you want to change the base?
Changes from 9 commits
b367f84
186f08d
8b12669
b346ccf
40a0740
4993fbd
76e27fa
1ecf0d7
ec54665
1ee3678
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
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 gcloud | ||
uses: 'google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a' # pin 2.1.2 | ||
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 |
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> |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -90,7 +90,7 @@ class AutomaticSpansTest : BaseUiTest() { | |||||
// AGP matrix tests have no frames | ||||||
Assume.assumeTrue(totalFrames > 0) | ||||||
assertNotEquals(totalFrames, 0) | ||||||
assertTrue(totalFrames > slowFrames + frozenFrames, "Expected total frames ($totalFrames) to be higher than the sum of slow ($slowFrames) and frozen ($frozenFrames) frames.") | ||||||
assertTrue(totalFrames >= slowFrames + frozenFrames, "Expected total frames ($totalFrames) to be higher than the sum of slow ($slowFrames) and frozen ($frozenFrames) frames.") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This test checks there is at least 1 normal frame that is summed to slow + frozen frames. That's why the test should be "long" enough to have at least 1 normal frame even on slower devices |
||||||
} | ||||||
assertNoOtherEnvelopes() | ||||||
} | ||||||
|
@@ -126,7 +126,7 @@ class AutomaticSpansTest : BaseUiTest() { | |||||
// AGP matrix tests have no frames | ||||||
Assume.assumeTrue(totalFrames > 0) | ||||||
assertNotEquals(totalFrames, 0) | ||||||
assertTrue(totalFrames > slowFrames + frozenFrames, "Expected total frames ($totalFrames) to be higher than the sum of slow ($slowFrames) and frozen ($frozenFrames) frames.") | ||||||
assertTrue(totalFrames >= slowFrames + frozenFrames, "Expected total frames ($totalFrames) to be higher than the sum of slow ($slowFrames) and frozen ($frozenFrames) frames.") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||||||
} | ||||||
assertNoOtherEnvelopes() | ||||||
} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.