paperwork icon indicating copy to clipboard operation
paperwork copied to clipboard

Add console logging to integration tests

Open zsoltk opened this issue 9 years ago • 1 comments

This works for unit tests, but has no effect on instrumentation tests:

testOptions.unitTests.all {
    testLogging {
        events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
        outputs.upToDateWhen { false }
        showStandardStreams = true
        exceptionFormat "full"
    }
}

This should do the job:

tasks.withType(com.android.build.gradle.internal.tasks.AndroidTestTask) { task ->
    task.doFirst {
        logging.level = LogLevel.INFO
    }

    task.doLast {
        logging.level = LogLevel.LIFECYCLE
    }
}

Except it doesn't. It seems to have zero effect on instrumentation tests, still only failures are logged.

When run with the --info switch, the passed tests are there, so the above should be working, too. What's wrong here? Anyone knows how to solve this?

zsoltk avatar Jan 16 '16 21:01 zsoltk

@zsoltk The first one is for unit tests and works fine. The second does not work at all.

jaredsburrows avatar May 09 '17 05:05 jaredsburrows