Merge pull request #2133 from kiwix/macgills/feature/2131-broken-instrumentation

#2131 PR instrumentation tests can fail silently
This commit is contained in:
Seán Mac Gillicuddy 2020-06-10 13:25:18 +01:00 committed by GitHub
commit 3f90d9bd5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 5 deletions

View File

@ -21,11 +21,18 @@ jobs:
fetch-depth: 1
- name: run instrumentation tests
uses: reactivecircus/android-emulator-runner@v2.0.0
uses: ReactiveCircus/android-emulator-runner@v2.8.0
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
script: ./gradlew connectedDebugAndroidTest
script: bash contrib/instrumentation_nightly.sh
- name: Upload screenshot result
uses: actions/upload-artifact@v1
if: failure()
with:
name: ${{ matrix.api-level }}
path: screencap.png
unit_test_and_release:
runs-on: ubuntu-latest

View File

@ -2,6 +2,9 @@
adb logcat -c
adb logcat *:E -v color &
./gradlew jacocoInstrumentationTestReport
adb exec-out screencap -p > screencap.png
find screencap.png
if ./gradlew jacocoInstrumentationTestReport; then
echo "jacocoInstrumentationTestReport succeeded" >&2
else
adb exec-out screencap -p >screencap.png
echo "jacocoInstrumentationTestReport failed" >&2
fi

View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
adb logcat -c
adb logcat *:E -v color &
if ./gradlew connectedDebugAndroidTest; then
echo "connectedDebugAndroidTest succeeded" >&2
else
adb exec-out screencap -p >screencap.png
echo "connectedDebugAndroidTest failed" >&2
fi