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 28, 2023
1 parent a3b8b1b commit 7ed3328
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
jobs:
instrumentation_tests:
runs-on: macos-11
fail-fast: false
strategy:
matrix:
emulator_type: [default, google_apis]
Expand All @@ -38,20 +39,9 @@ jobs:
~/.android/adb*
key: aosp-${{ matrix.emulator_type }}-33

- name: Test data cache
uses: actions/cache@v3
id: test-data-cache
with:
path: backup.tar.gz
key: test-data-1

- name: Build Release APK
run: ./gradlew :app:assembleRelease

- name: Download test data
if: steps.test-data-cache.outputs.cache-hit != 'true'
run: wget --quiet https://github.com/seedvault-app/seedvault-test-data/releases/download/1/backup.tar.gz

- name: Create AVD snapshot
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
Expand Down Expand Up @@ -101,6 +91,7 @@ jobs:
sleep 10
adb shell bmgr transport com.stevesoltys.seedvault.transport.ConfigurableBackupTransport
wget --quiet https://github.com/seedvault-app/seedvault-test-data/releases/download/1/backup.tar.gz
adb shell mkdir -p /sdcard/seedvault_baseline
adb push backup.tar.gz /sdcard/seedvault_baseline
adb wait-for-device
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ internal interface LargeBackupTestBase : LargeTestBase {
fun startBackup() {
BackupScreen {

if(!backupManager.isBackupEnabled) {
if (!backupManager.isBackupEnabled) {
backupSwitch.click()
waitUntilIdle()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ internal interface LargeRestoreTestBase : LargeTestBase {

waitForInstallResult()

if(someAppsNotInstalledText.exists()) {
if (someAppsNotInstalledText.exists()) {
device.pressBack()
}

nextButton.clickAndWaitForNewWindow()

waitForRestoreDataResult()

if(someAppsNotRestoredText.exists()) {
if (someAppsNotRestoredText.exists()) {
device.pressBack()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,11 @@ internal interface LargeTestBase : KoinComponent {
val extDir = externalStorageDir

device.executeShellCommand("rm -R $extDir/.SeedVaultAndroidBackup")
device.executeShellCommand("cp -R $extDir/${folderName}/.SeedVaultAndroidBackup $extDir")
device.executeShellCommand("cp -R $extDir/${folderName}/recovery-code.txt $extDir")
device.executeShellCommand(
"cp -R $extDir/$folderName/" +
".SeedVaultAndroidBackup $extDir"
)
device.executeShellCommand("cp -R $extDir/$folderName/recovery-code.txt $extDir")

BackupScreen {
internalStorageButton.clickAndWaitForNewWindow()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ internal abstract class SeedvaultLargeTest :
val extDir = externalStorageDir

device.executeShellCommand("rm -R $extDir/.SeedVaultAndroidBackup")
device.executeShellCommand("cp -R $extDir/$BASELINE_BACKUP_FOLDER/.SeedVaultAndroidBackup $extDir")
device.executeShellCommand("cp -R $extDir/$BASELINE_BACKUP_FOLDER/recovery-code.txt $extDir")
device.executeShellCommand("cp -R $extDir/$BASELINE_BACKUP_FOLDER/" +
".SeedVaultAndroidBackup $extDir")
device.executeShellCommand("cp -R $extDir/$BASELINE_BACKUP_FOLDER/" +
"recovery-code.txt $extDir")
}

if (backupFile.exists()) {
Expand Down

0 comments on commit 7ed3328

Please sign in to comment.