Merge pull request #1282 from kiwix/feature/macgills/fail-fast-instrumentation

Move Instrumentation first and use TestOrchestrator to minimise memor…
This commit is contained in:
macgills 2019-07-10 16:39:07 +01:00 committed by GitHub
commit 7c24a0e803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -49,25 +49,24 @@ android:
licenses:
- ".+"
script:
- ./gradlew assemble lintKiwixDebug jacocoTestKiwixDebugUnitTestReport
before_script:
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI -c 100M
- emulator -avd test -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
- adb -e logcat *:D > logcat.log &
- ./gradlew createKiwixDebugCoverageReport
script:
- ./gradlew createKiwixDebugCoverageReport lintKiwixDebug jacocoTestKiwixDebugUnitTestReport assemble
after_success:
- bash <(curl -s https://codecov.io/bash)
- ./gradlew kiwixtestUploadKiwix assembleKiwixRelease
- ./gradlew kiwixtestUploadKiwix
after_failure:
- export LOG_DIR = ${TRAVIS_HOME}/build/kiwix/kiwix-android/app/build/outputs/reports/androidTests/connected/flavors/KIWIX/
- lynx --dump ${LOG_DIR}com.android.builder.testing.ConnectedDevice.html
- lynx --dump ${LOG_DIR}com.android.builder.testing.html
- lynx --dump ${LOG_DIR}org.kiwix.kiwixmobile.tests.BasicTest.html;
- echo " LOGCAT "; echo "========"; cat logcat.log; pkill -KILL -f adb
before_deploy:
# - export APP_CHANGELOG=$(cat app/src/kiwix/play/release-notes/en-US/default.txt)

View File

@ -83,6 +83,7 @@ dependencies {
androidTestImplementation "androidx.test:rules:1.2.0"
androidTestImplementation "androidx.test:core:1.2.0"
androidTestImplementation "com.squareup.okhttp3:mockwebserver:3.6.0"
androidTestUtil 'androidx.test:orchestrator:1.1.0'
// Mockito
androidTestImplementation "org.mockito:mockito-android:$mockitoVersion"
@ -235,6 +236,7 @@ android {
}
testOptions {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
unitTests.returnDefaultValues = true
unitTests.all {
useJUnitPlatform()