1
0
mirror of https://github.com/nextcloud/talk-android synced 2025-07-06 12:29:47 +01:00

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,8 +1,9 @@
kind: pipeline
type: docker
name: generic
steps:
- name: generic
- name: generic
image: nextcloudci/android:android-44
commands:
- ./gradlew --console=plain assembleGeneric
@ -16,10 +17,11 @@ trigger:
---
kind: pipeline
type: docker
name: gplay
steps:
- name: gplay
- name: gplay
image: nextcloudci/android:android-44
commands:
- ./gradlew --console=plain assembleGplay
@ -30,12 +32,59 @@ trigger:
event:
- push
- pull_request
---
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
steps:
- name: analysis
- name: analysis
image: nextcloudci/android:android-44
environment:
GIT_USERNAME:
@ -50,7 +99,7 @@ steps:
- export BRANCH=$(scripts/analysis/getBranchName.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST)
- scripts/analysis/analysis-wrapper.sh $GIT_USERNAME $GIT_TOKEN $BRANCH $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER $DRONE_PULL_REQUEST
- name: notify
- name: notify
image: drillster/drone-email
host: $EMAIL_HOST
port: 587

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"