TestNG reports add extra "test" folder


(JDev) #1

Earlier I was using Gradle 2.14.1 and gw build command saves test results in /build/test-results and /build/reports/tests folders.

I am using testNG.

Recently I have updated to Gradle 3.5 and now gw build stores test results in /build/test-results/test and \build\reports\tests\test folders. Here new ‘test’ folder is being added.

I dont want extra ‘test’ folder as it breaks my Jenkins job.

Test configuration looks as below.

test {
        debug = false
        systemProperty 'java.io.tmpdir', buildDir

        useTestNG() {
            useDefaultListeners = true
            excludeGroups 'db'
        }

        testLogging {
            exceptionFormat = 'full'
            events 'started', 'passed', 'skipped', 'failed'
        }
        exclude '**/*IT.class'
    }

Thanks in advance.


(René Groeschke) #2

the extra test in the path reflects the name of the task these tests are run in to distinguish between different tasks of type test in the same project. you can get back the old behaviour by setting the output directory for the report explicitly:

test {
    reports.junitXml.destination = file("$buildDir/junitXml")
    reports.html.destination = file("$buildDir/html")
}