Skip to content

Commit

Permalink
Switch to GitHub actions for E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stevesoltys committed Sep 27, 2023
1 parent bdfef12 commit 0da1cce
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 58 deletions.
104 changes: 52 additions & 52 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,55 +52,55 @@ jobs:
./app/development/scripts/provision_emulator.sh "test" "system-images;android-33;google_apis;x86_64"
echo "Generated AVD snapshot for caching."
- name: Assemble tests
run: ./gradlew :app:assembleAndroidTest

- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 33
target: google_apis
arch: x86_64
force-avd-creation: false
emulator-options: -writable-system -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
adb root
sleep 5
adb remount
adb reboot
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
adb root
sleep 5
adb remount
echo "Installing Seedvault app..."
adb shell mkdir -p /system/priv-app/Seedvault
adb push app/build/outputs/apk/release/app-release.apk /system/priv-app/Seedvault/Seedvault.apk
echo "Installing Seedvault permissions..."
adb push permissions_com.stevesoltys.seedvault.xml /system/etc/permissions/privapp-permissions-seedvault.xml
adb push allowlist_com.stevesoltys.seedvault.xml /system/etc/sysconfig/allowlist-seedvault.xml
echo "Setting Seedvault transport..."
sleep 10
adb shell bmgr transport com.stevesoltys.seedvault.transport.ConfigurableBackupTransport
gradle_exit_code=0
./gradlew --stacktrace -Pinstrumented_test_size=large :app:connectedAndroidTest || gradle_exit_code=$?
adb pull /sdcard/seedvault_test_videos
if [ $gradle_exit_code -ne 0 ]; then
echo "Gradle test failed."
exit 1
fi
- name: Upload screenshots and videos
if: always()
uses: actions/upload-artifact@v3
with:
name: seedvault_test_videos
path: seedvault_test_videos/**/*.mp4
# - name: Assemble tests
# run: ./gradlew :app:assembleAndroidTest
#
# - name: Run tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: 33
# target: google_apis
# arch: x86_64
# force-avd-creation: false
# emulator-options: -writable-system -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
# disable-animations: true
# script: |
# adb root
# sleep 5
# adb remount
# adb reboot
#
# adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
#
# adb root
# sleep 5
# adb remount
#
# echo "Installing Seedvault app..."
# adb shell mkdir -p /system/priv-app/Seedvault
# adb push app/build/outputs/apk/release/app-release.apk /system/priv-app/Seedvault/Seedvault.apk
#
# echo "Installing Seedvault permissions..."
# adb push permissions_com.stevesoltys.seedvault.xml /system/etc/permissions/privapp-permissions-seedvault.xml
# adb push allowlist_com.stevesoltys.seedvault.xml /system/etc/sysconfig/allowlist-seedvault.xml
#
# echo "Setting Seedvault transport..."
# sleep 10
# adb shell bmgr transport com.stevesoltys.seedvault.transport.ConfigurableBackupTransport
#
# gradle_exit_code=0
# ./gradlew --stacktrace -Pinstrumented_test_size=large :app:connectedAndroidTest || gradle_exit_code=$?
#
# adb pull /sdcard/seedvault_test_videos
#
# if [ $gradle_exit_code -ne 0 ]; then
# echo "Gradle test failed."
# exit 1
# fi
#
# - name: Upload screenshots and videos
# if: always()
# uses: actions/upload-artifact@v3
# with:
# name: seedvault_test_videos
# path: seedvault_test_videos/**/*.mp4
16 changes: 10 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ gradle.projectsEvaluated {
}
}

tasks.withType(Test).configureEach {
testLogging {
showExceptions true
showCauses true
showStackTraces true

exceptionFormat = 'full'
}
}

configurations {
all {
resolutionStrategy {
Expand All @@ -181,12 +191,6 @@ configurations {
}
}

tasks.withType(Test) {
testLogging {
exceptionFormat = 'full'
}
}

tasks.register('provisionEmulator', Exec) {
group("emulator")

Expand Down

0 comments on commit 0da1cce

Please sign in to comment.