summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2022-02-01 08:14:45 +0100
committerAlbin <albin@mullvad.net>2022-02-01 14:38:28 +0100
commitad73cc1018ac3f5422d52931036dae4887cb7e5d (patch)
tree9cf2d37e11787a48953096201a552d4db77040fd
parenteffe4ab7e4050879640baeb2b57f198c887d0779 (diff)
downloadmullvadvpn-ad73cc1018ac3f5422d52931036dae4887cb7e5d.tar.xz
mullvadvpn-ad73cc1018ac3f5422d52931036dae4887cb7e5d.zip
Run instrumented tests using prebuilt apks
-rw-r--r--.github/workflows/android-app.yml29
-rwxr-xr-xci/run-android-instrumented-tests.sh6
2 files changed, 10 insertions, 25 deletions
diff --git a/.github/workflows/android-app.yml b/.github/workflows/android-app.yml
index f72a295785..2f4884fd3f 100644
--- a/.github/workflows/android-app.yml
+++ b/.github/workflows/android-app.yml
@@ -107,6 +107,7 @@ jobs:
cd android
./gradlew --console plain assembleDebug
./gradlew testDebugUnitTest
+ ./gradlew assembleAndroidTest
- name: Upload apks
uses: actions/upload-artifact@v2
@@ -128,30 +129,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
- - name: Declare commit sha variable
- id: vars
- shell: bash
- run: |
- echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
-
- - name: Set up Java
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
-
- - uses: gradle/wrapper-validation-action@v1
-
- - name: Configure cache
- uses: actions/cache@v2
+ - uses: actions/download-artifact@v2
with:
- path: |
- ~/.gradle/caches
- ~/.gradle/wrapper
- ./android/build
- ./android/app/build
- key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-${{ steps.vars.outputs.sha_short }}
- restore-keys: |
- gradle-${{ steps.vars.outputs.sha_short }}
+ name: apks
- name: Run Android instrumented tests
uses: reactivecircus/android-emulator-runner@v2
@@ -161,7 +141,6 @@ jobs:
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot-load -noaudio -no-boot-anim
disable-animations: true
profile: pixel
- script: ./gradlew connectedCheck --stacktrace
- working-directory: ./android
+ script: ./ci/run-android-instrumented-tests.sh $(pwd)
env:
API_LEVEL: 29
diff --git a/ci/run-android-instrumented-tests.sh b/ci/run-android-instrumented-tests.sh
new file mode 100755
index 0000000000..54230ac801
--- /dev/null
+++ b/ci/run-android-instrumented-tests.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+APK_BASE_DIR=$1
+adb install "$APK_BASE_DIR/debug/app-debug.apk"
+adb install "$APK_BASE_DIR/androidTest/debug/app-debug-androidTest.apk"
+adb shell am instrument -w net.mullvad.mullvadvpn.test/androidx.test.runner.AndroidJUnitRunner