Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle tests report for Android Tests

Can I have gradle tests report for android tests? I want to have the report directly in the terminal. Every time a test is passed, failed or skipped I want to have the report printed in the terminal with the name of the test and the status.

For Unit tests I can add this to the gradle file to have the reports:

tasks.withType(Test) {
    testLogging {
        exceptionFormat "full"
        events "passed", "skipped", "failed"
    }
}

I didn't find any solution to the android tests.

like image 252
Sandro Machado Avatar asked Oct 31 '22 05:10

Sandro Machado


1 Answers

You can try this (add to app/library build.gradle)

tasks.withType(com.android.build.gradle.internal.tasks.AndroidTestTask) { task ->
    task.doFirst {
        logging.level = LogLevel.INFO
    }
    task.doLast {
        logging.level = LogLevel.LIFECYCLE
    }
}
like image 172
Artem Zinnatullin Avatar answered Nov 09 '22 09:11

Artem Zinnatullin