Disable UI tests on Travis CI

Unfortunately, the UI tests are just too unstable, so this patch excludes them
from being run on Travis. The tests run fine on our personal machines, but
produce seemingly random errors on Travis CI.
This commit is contained in:
Alexander Bakker 2020-08-02 13:33:51 +02:00
parent 9e4313e138
commit ce3d674da8
2 changed files with 2 additions and 66 deletions

View file

@ -3,22 +3,10 @@ os: linux
dist: bionic
env:
global:
- TERM=dumb
- ABI=x86_64
- EMU_FLAVOR=default
- ADB_INSTALL_TIMEOUT=16
- ANDROID_HOME=${HOME}/android
- ANDROID_SDK_ROOT=${ANDROID_HOME}
- TOOLS=${ANDROID_HOME}/cmdline-tools
- PATH=${ANDROID_HOME}/emulator:${TOOLS}/tools/bin:${ANDROID_HOME}/platform-tools:${PATH}
jobs:
- API=21
- API=23
#- API=25 <- inconsistent
- API=27
- API=28
#- API=29 <- emulator crashes
#- API=R EMU_FLAVOR=google_apis <- too heavy, re-enable when AOSP image is available
before_install:
- mkdir -p ${ANDROID_HOME}/licenses
- echo "8933bad161af4178b1185d1a37fbf41ea5269c55" > ${ANDROID_HOME}/licenses/android-sdk-license
@ -30,26 +18,7 @@ install:
- unzip ${TOOLS}/tools.zip -d ${TOOLS}
- yes | travis_retry sdkmanager "platform-tools" > /dev/null
- yes | travis_retry sdkmanager "tools" > /dev/null
- yes | travis_retry sdkmanager "build-tools;29.0.2" > /dev/null
- yes | travis_retry sdkmanager "platforms;android-29" > /dev/null
- yes | travis_retry sdkmanager "emulator" > /dev/null
- yes | travis_retry sdkmanager "system-images;android-$API;$EMU_FLAVOR;$ABI" > /dev/null
- travis_retry sudo apt-get -yq --no-install-suggests install qemu-kvm
before_script:
- sudo gpasswd -a $USER kvm
- yes | travis_retry sdkmanager "build-tools;30.0.1" > /dev/null
- yes | travis_retry sdkmanager "platforms;android-30" > /dev/null
script:
- ./gradlew assemble check
- echo no | avdmanager create avd --force -n test -k "system-images;android-$API;$EMU_FLAVOR;$ABI" -d "Nexus 5X" -c 128M
- sudo -E sudo -u $USER -E bash -c "${ANDROID_HOME}/emulator/emulator -verbose -avd test -gpu swiftshader_indirect -no-audio -no-boot-anim -no-snapshot -no-window -camera-back none -camera-front none -selinux permissive -memory 3072 &"
- adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
- adb shell settings put global window_animation_scale 0
- adb shell settings put global transition_animation_scale 0
- adb shell settings put global animator_duration_scale 0
- adb reboot
- adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'
- adb shell input keyevent 82 &
- bash .travis/android-wait-for-launcher.sh
- adb logcat -c
- ./gradlew connectedCheck
after_failure:
- adb logcat -d

View file

@ -1,33 +0,0 @@
#!/bin/bash
# source: https://gist.github.com/d4vidi/7862d60375b38f8970f824c4ce0ad2a9
echo ""
echo "[Waiting for launcher to start]"
LAUNCHER_READY=
while [[ -z ${LAUNCHER_READY} ]]; do
UI_FOCUS=`adb shell dumpsys activity activities 2>/dev/null | grep -i mResumedActivity`
echo "(DEBUG) Current focus: ${UI_FOCUS}"
case $UI_FOCUS in
*"Launcher"*)
LAUNCHER_READY=true
;;
"")
echo "Waiting for window service..."
sleep 3
;;
*"Not Responding"*)
echo "Detected an ANR! Dismissing..."
adb shell input keyevent KEYCODE_DPAD_DOWN
adb shell input keyevent KEYCODE_DPAD_DOWN
adb shell input keyevent KEYCODE_ENTER
;;
*)
echo "Waiting for launcher..."
sleep 3
;;
esac
done
echo "Launcher is ready :-)"