test other image

This commit is contained in:
Matthieu 2022-12-31 22:57:54 +01:00
parent e27224725d
commit 29f09fc0dd
1 changed files with 21 additions and 6 deletions

View File

@ -74,14 +74,29 @@ debugTests:
.connected-template: &connected-template
extends: .base
allow_failure: true
image: briar/ci-image-android-emulator:latest
stage: test
script:
- start-emulator
- wait-for-emulator
- adb devices
- adb shell input keyevent 82 &
# Switch to right java version for building the app
- ./gradlew connectedStagingAndroidTest --info || (adb -e logcat -d > logcat.txt; exit 1)
- apt-get update || apt-get update
- apt-get install -y openjdk-17-jdk-headless
- update-alternatives --auto java
- ./gradlew assembleStaging
- export AVD_SDK=`echo $CI_JOB_NAME | awk '{print $2}'`
- export AVD_TAG=`echo $CI_JOB_NAME | awk '{print $3}'`
- export AVD_ARCH=`echo $CI_JOB_NAME | awk '{print $4}'`
- export AVD_PACKAGE="system-images;android-${AVD_SDK};${AVD_TAG};${AVD_ARCH}"
- echo $AVD_PACKAGE
- $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager --verbose delete avd --name "$NAME_AVD"
- export AVD="$AVD_PACKAGE"
- echo y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "$AVD"
- echo no | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager --verbose create avd --name "$NAME_AVD" --package "$AVD" --device "pixel"
- start-emulator.sh
- ./gradlew installStaging
- adb shell am start -n org.pixeldroid.app.debug/org.pixeldroid.app.MainActivity
- if [ $AVD_SDK -lt 25 ] || ! emulator -accel-check; then
export FLAG=-Pandroid.testInstrumentationRunnerArguments.notAnnotation=androidx.test.filters.LargeTest;
fi
- ./gradlew connectedStagingAndroidTest $FLAG --info || (adb -e logcat -d > logcat.txt; exit 1)
artifacts:
paths:
- logcat.txt