Add pipeline tests

Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
Tim Krüger 2021-12-07 14:06:17 +01:00
parent 390fa154b5
commit d7b3ba17de
No known key found for this signature in database
GPG Key ID: FECE3A7222C52A4E
2 changed files with 134 additions and 61 deletions

View File

@ -1,4 +1,5 @@
kind: pipeline kind: pipeline
type: docker
name: generic name: generic
steps: steps:
@ -16,6 +17,7 @@ trigger:
--- ---
kind: pipeline kind: pipeline
type: docker
name: gplay name: gplay
steps: steps:
@ -30,8 +32,55 @@ trigger:
event: event:
- push - push
- pull_request - pull_request
--- ---
kind: pipeline kind: pipeline
type: docker
name: tests
steps:
- name: tests
image: nextcloudci/android:android-49
privileged: true
commands:
- emulator-headless -avd android-27 -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
- scripts/wait_for_emulator.sh
- ./gradlew --console=plain connectedGplayDebugAndroidTest
#services:
# - name: server
# image: nextcloudci/server:server-17 # also change in updateScreenshots.sh
# environment:
# EVAL: true
# commands:
# - BRANCH='stable22' /usr/local/bin/initnc.sh
# - echo 127.0.0.1 server >> /etc/hosts
# - su www-data -c "OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1"
# - su www-data -c "OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2"
# - su www-data -c "OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3"
# - su www-data -c "php /var/www/html/occ user:setting user2 files quota 1G"
# - su www-data -c "php /var/www/html/occ group:add users"
# - su www-data -c "php /var/www/html/occ group:adduser users user1"
# - su www-data -c "php /var/www/html/occ group:adduser users user2"
# - su www-data -c "git clone -b stable22 https://github.com/nextcloud/activity.git /var/www/html/apps/activity/"
# - su www-data -c "php /var/www/html/occ app:enable activity"
# - su www-data -c "git clone -b stable22 https://github.com/nextcloud/text.git /var/www/html/apps/text/"
# - su www-data -c "php /var/www/html/occ app:enable text"
# - su www-data -c "git clone -b stable22 https://github.com/nextcloud/end_to_end_encryption.git /var/www/html/apps/end_to_end_encryption/"
# - su www-data -c "php /var/www/html/occ app:enable end_to_end_encryption"
# - /usr/local/bin/run.sh
trigger:
branch:
- master
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: analysis name: analysis
steps: steps:

24
scripts/wait_for_emulator.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# Originally written by Ralf Kistner <ralf@embarkmobile.com>, but placed in the public domain
bootanim=""
failcounter=0
checkcounter=0
until [[ "$bootanim" =~ "stopped" ]]; do
bootanim=`adb -e shell getprop init.svc.bootanim 2>&1`
echo "($checkcounter) $bootanim"
if [[ "$bootanim" =~ "not found" || "$bootanim" =~ "error" ]]; then
let "failcounter += 1"
if [[ $failcounter -gt 3 ]]; then
echo "Failed to start emulator"
exit 1
fi
fi
let "checkcounter += 1"
sleep 20
done
echo "($checkcounter) Done"
adb -e shell input keyevent 82
echo "($checkcounter) Unlocked emulator screen"