diff --git a/.drone.yml b/.drone.yml index 302f03d8bb..9ad1bc491e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -103,14 +103,7 @@ steps: - emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 & - sed -i s'#false#true#'g src/main/res/values/setup.xml - sed -i s"#1#5#" ./src/androidTest/java/com/nextcloud/client/RetryTestRule.kt - - ./gradlew assembleGplay - - ./gradlew assembleGplayDebug - - scripts/wait_for_emulator.sh - - ./gradlew jacocoTestGplayDebugUnitTestReport && scripts/deleteOutdatedComments.sh "master" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN - - ./gradlew installGplayDebugAndroidTest - - scripts/wait_for_server.sh "server" - - ./gradlew createGplayDebugCoverageReport -Pcoverage -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest && scripts/deleteOutdatedComments.sh "master" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN - - scripts/runCombinedTest.sh + - scripts/runCombinedTest.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER - name: notify image: drillster/drone-email diff --git a/scripts/runCombinedTest.sh b/scripts/runCombinedTest.sh index fc4213a2ea..86636f4da5 100755 --- a/scripts/runCombinedTest.sh +++ b/scripts/runCombinedTest.sh @@ -1,5 +1,36 @@ #!/bin/bash +GIT_USERNAME=$1 +GIT_TOKEN=$2 +DRONE_PULL_REQUEST=$3 +LOG_USERNAME=$4 +LOG_PASSWORD=$5 +DRONE_BUILD_NUMBER=$6 + +./gradlew assembleGplay +./gradlew assembleGplayDebug + +scripts/wait_for_emulator.sh +./gradlew jacocoTestGplayDebugUnitTestReport +status=$? + +if [ $status -eq 0 ]; then + scripts/deleteOutdatedComments.sh "master" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN +else + bash scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN +fi + +./gradlew installGplayDebugAndroidTest +scripts/wait_for_server.sh "server" +./gradlew createGplayDebugCoverageReport -Pcoverage -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest +status=$? + +if [ $status -eq 0 ]; then + scripts/deleteOutdatedComments.sh "master" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN +else + bash scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN +fi + ./gradlew combinedTestReport status=$?