Browse Source

Increased verbosity of logs for local unit tests

David A. Velasco 9 years ago
parent
commit
950dbe2013

+ 5 - 5
.travis.yml

@@ -16,12 +16,12 @@ before_install:
 script:
 # build app and assemble APK, in debug mode
   - ./gradlew assembleDebug
-# run all the local unit tests
-  - ./gradlew testDebug
+# run all the local unit tests of app module
+  - ./gradlew :testDebug
 # - ./gradlew connectedAndroidTest
-# install app, then assemble and install instrumented tests
-  - ./gradlew installDebug
-  - ./gradlew installDebugAndroidTest
+# install app, then assemble and install instrumented tests of app module
+  - ./gradlew :installDebug
+  - ./gradlew :installDebugAndroidTest
 # run sample instrumented unit test
   - adb shell am instrument -w -e debug false -e class com.owncloud.android.datamodel.OCFileUnitTest com.owncloud.android.test/android.support.test.runner.AndroidJUnitRunner
 env:

+ 0 - 2
androidTest/java/com/owncloud/android/authentication/AuthenticatorActivityTest.java

@@ -75,7 +75,6 @@ public class AuthenticatorActivityTest {
                 .check(matches(not(isEnabled())));
 
         // Type server url
-        /*
         onView(withId(R.id.hostUrlInput))
                 .perform(typeText(BuildConfig.TEST_SERVER_URL), closeSoftKeyboard());
         onView(withId(R.id.account_username)).perform(click());
@@ -88,7 +87,6 @@ public class AuthenticatorActivityTest {
         onView(withId(R.id.account_password))
                 .perform(typeText(BuildConfig.TEST_PASSWORD), closeSoftKeyboard());
         onView(withId(R.id.buttonOK)).perform(click());
-        */
 
         // Check that login button is now enabled
         onView(withId(R.id.buttonOK)).check(matches(isEnabled()));

+ 11 - 9
build.gradle

@@ -59,6 +59,13 @@ dependencies {
 
 }
 
+tasks.withType(Test) {
+    /// increased logging for tests
+    testLogging {
+        events "passed", "skipped", "failed"
+    }
+}
+
 android {
     compileSdkVersion 23
     buildToolsVersion "23.0.3"
@@ -66,9 +73,9 @@ android {
     defaultConfig {
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 
-        testInstrumentationRunnerArguments TEST_USER: "${TEST_USER}"
-        testInstrumentationRunnerArguments TEST_PASSWORD: "${TEST_PASSWORD}"
-        testInstrumentationRunnerArguments TEST_SERVER_URL: "${TEST_SERVER_URL}"
+        buildConfigField "String", "TEST_USER",  "\"${TEST_USER}\""
+        buildConfigField "String", "TEST_PASSWORD",  "\"${TEST_PASSWORD}\""
+        buildConfigField "String", "TEST_SERVER_URL",  "\"${TEST_SERVER_URL}\""
     }
 
     // adapt structure from Eclipse to Gradle/Android Studio expectations;
@@ -113,10 +120,5 @@ android {
     packagingOptions {
         exclude 'META-INF/LICENSE.txt'
     }
-}
-
-
-
-
-
 
+}