runCombinedTest.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. GIT_USERNAME=$1
  3. GIT_TOKEN=$2
  4. DRONE_PULL_REQUEST=$3
  5. LOG_USERNAME=$4
  6. LOG_PASSWORD=$5
  7. DRONE_BUILD_NUMBER=$6
  8. scripts/deleteOldComments.sh "master" "Unit" $DRONE_PULL_REQUEST $GIT_TOKEN
  9. scripts/deleteOldComments.sh "master" "IT" $DRONE_PULL_REQUEST $GIT_TOKEN
  10. ./gradlew assembleGplay
  11. ./gradlew assembleGplayDebug
  12. scripts/wait_for_emulator.sh
  13. ./gradlew jacocoTestGplayDebugUnitTestReport
  14. stat=$?
  15. if [ ! $stat -eq 0 ]; then
  16. bash scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "Unit" $DRONE_PULL_REQUEST $GIT_TOKEN
  17. fi
  18. ./gradlew installGplayDebugAndroidTest
  19. scripts/wait_for_server.sh "server"
  20. ./gradlew createGplayDebugCoverageReport -Pcoverage -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest
  21. stat=$(( stat | $? ))
  22. if [ ! $stat -eq 0 ]; then
  23. bash scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "IT" $DRONE_PULL_REQUEST $GIT_TOKEN
  24. fi
  25. ./gradlew combinedTestReport
  26. stat=$(( stat | $? ))
  27. curl -Os https://uploader.codecov.io/latest/linux/codecov
  28. chmod +x codecov
  29. ./codecov -t fc506ba4-33c3-43e4-a760-aada38c24fd5
  30. echo "Exit with: " $stat
  31. exit $stat