Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,23 @@ steps:
from_secret: GIT_TOKEN
commands:
- scripts/checkIfRunDrone.sh $DRONE_PULL_REQUEST || exit 0
- export _CP=$SECONDS; checkpoint() { echo "=== +$(($SECONDS - $_CP))s === $*"; export _CP=$SECONDS; }
- checkpoint "Starting emulator"
- emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
- sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g app/src/main/res/values/setup.xml
- checkpoint "assembleGplayDebugAndroidTest"
- ./gradlew assembleGplayDebugAndroidTest
- checkpoint "Waiting for emulator"
- scripts/wait_for_emulator.sh
- checkpoint "installGplayDebugAndroidTest"
- ./gradlew installGplayDebugAndroidTest
- checkpoint "Waiting for server"
- scripts/wait_for_server.sh "server"
- checkpoint "deleteOldComments"
- scripts/deleteOldComments.sh "stable" "IT" $DRONE_PULL_REQUEST
- checkpoint "createGplayDebugCoverageReport"
- ./gradlew createGplayDebugCoverageReport -Pcoverage -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "IT" $DRONE_PULL_REQUEST
- checkpoint "Done"

services:
- name: server
Expand Down Expand Up @@ -88,9 +97,13 @@ steps:
from_secret: GIT_TOKEN
commands:
- scripts/checkIfRunDrone.sh $DRONE_PULL_REQUEST || exit 0
- export _CP=$SECONDS; checkpoint() { echo "=== +$(($SECONDS - $_CP))s === $*"; export _CP=$SECONDS; }
- checkpoint "Starting emulator"
- emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
- sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g app/src/main/res/values/setup.xml
- checkpoint "runCombinedTest"
- scripts/runCombinedTest.sh $DRONE_PULL_REQUEST $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER
- checkpoint "Done"

services:
- name: server
Expand Down
8 changes: 8 additions & 0 deletions scripts/runCombinedTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ DRONE_PULL_REQUEST=$1
LOG_USERNAME=$2
LOG_PASSWORD=$3
DRONE_BUILD_NUMBER=$4
_CP=$SECONDS; checkpoint() { echo "=== +$(($SECONDS - $_CP))s === $*"; _CP=$SECONDS; }

function upload_logcat() {
log_filename="${DRONE_PULL_REQUEST}_logcat.txt.xz"
Expand All @@ -21,14 +22,20 @@ function upload_logcat() {

scripts/deleteOldComments.sh "master" "IT" "$DRONE_PULL_REQUEST"

checkpoint "assembleGplayDebugAndroidTest"
./gradlew assembleGplayDebugAndroidTest

checkpoint "Waiting for emulator"
scripts/wait_for_emulator.sh || exit 1

checkpoint "installGplayDebugAndroidTest"
./gradlew installGplayDebugAndroidTest

checkpoint "Waiting for server"
scripts/wait_for_server.sh "server" || exit 1

# clear logcat and start saving it to file
checkpoint "createGplayDebugCoverageReport"
adb logcat -c
adb logcat > logcat.txt &
LOGCAT_PID=$!
Expand All @@ -37,6 +44,7 @@ LOGCAT_PID=$!
-Dorg.gradle.jvmargs="--add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.nio.channels=ALL-UNNAMED --add-exports java.base/sun.nio.ch=ALL-UNNAMED"

stat=$?
checkpoint "Tests finished (exit code: $stat)"
# stop saving logcat
kill $LOGCAT_PID

Expand Down
Loading