From d29994fdba51051d0834e741a7d8fc8de3618bbc Mon Sep 17 00:00:00 2001 From: Sean Mac Gillicuddy Date: Wed, 10 Jul 2019 15:51:22 +0100 Subject: [PATCH] Move Instrumentation first and use TestOrchestrator to minimise memory usage --- .travis.yml | 11 +++++------ app/build.gradle | 2 ++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 52675ed48..5a95a9093 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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) diff --git a/app/build.gradle b/app/build.gradle index 2e8506008..a65e5c861 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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()