Q:

Getting XML / HTML test results for android gradle junit test run

I'm having a hard time finding xml / html test results after running my tests through gradle either with ./gradlew test or ./gradlew testDebug. When I run either of those I wind up with an html file that shows 0 tests and no xml file at all.
According to the android docs XML test results should be in path_to_your_project/module_name/build/test-results/ but the test-results folder only has .bin files in it (results.bin, etc). I also tried searching with find app/build -type f -name "*.xml" but only found Android related XML files (manifest, merge files, etc).
Output from ./gradlew --version
------------------------------------------------------------
Gradle 5.1.1
------------------------------------------------------------

Build time:   2019-01-10 23:05:02 UTC
Revision:     3c9abb645fb83932c44e8610642393ad62116807

Kotlin DSL:   1.1.1
Kotlin:       1.3.11
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          1.8.0_212 (Oracle Corporation 25.212-b03)
OS:           Linux 4.15.0-50-generic amd64

I want to get test results to publish to jenkins. I have the same issue if I run on my local MBP as well. I have not modified any of the gradle test configurations but the link above seems to suggest I shouldn't need to.
I also tried specifying my test directory with
android {
    ...
    sourceSets {
        androidTest {
            java.srcDirs = ['src/test/java']
        }
    }
}

A:

Turns out I was missing this from my /app/build.gradle
android {
  ...
  testOptions {
    unitTests.all {
      useJUnitPlatform()
    }
  }
}

This guide helped me figure that out

