Currently I build my Gradle app by running gradle clean build. This exercises JUnit tests and produces XML test results in my project under build/test-res
gradle clean build
build/test-res
test { reports { junitXml.enabled = false html.enabled = true } }
To figure this out on your own, start from Test in the Gradle Build Language Reference, then drill down into (the type for) reports.
Test
reports