Android Studio 3.0 Canary 1 - Kotlin unit tests don't run from command line

This might be a silly question but…


Using Android Studio 3.0 Canary 1:

Create new android project with kotlin support.
Change the assertion in ExampleUnitTest to assertEquals(5, (2 + 2).toLong())
From the command line ./gradlew clean test

The build does not fail and the kotlin unit test does not appear to run. It does run (and fail) from inside Android Studio.

The kotlin instrumented test works from the command line, just not the kotlin unit test.

What am I doing wrong, does something else need to be added to the build.gradle or the test class?

it’s answered here, or check out my example repo here: GitHub - vuhung3990/StarterKit

This following is what is currently needs to be added to app/build.gradle to make it work.

afterEvaluate {
    testReleaseUnitTest.dependsOn copyKotlinReleaseUnitTestClasses

task copyKotlinReleaseUnitTestClasses(type: Copy) {
    from "build/tmp/kotlin-classes/releaseUnitTest"
    into "build/intermediates/classes/test/release"