Why are my testng test results empty?

Using Gradle 1.7 and TestNG 6.0.1.

My build.gradle is simple (listed below). When I have a failing test I receive the message:

There were failing tests. See the report at: file:///[…]/build/reports/tests/index.html

However, that report states “0 tests” and “0 failures”.

I am new to both Gradle and TestNG.


apply plugin: ‘java’

repositories {

mavenCentral() }

test {

useTestNG() }

dependencies {

testCompile group: ‘org.testng’, name: ‘testng’, version: ‘6.0.1’ }

Unfortunately I’ve seen this happen a few too many times. It tends to be due to TestNG failing during test initialization. If you run gradle with --debug you will likely see a stacktrace with a hint to the cause. I suspect this is more TestNG’s fault than Gradle’s, but better error handling by Gradle would be greatly appreciated.