mardi 26 mai 2015

Gradle configuring TestNG and JUnit reports dirs

I am relatively new to gradle and we use both JUnit and testNG unit tests in our project. With google help I figured out how to make both testNG and JUnit tests running. Below is how I ended up by achieving it

build.gradle
....    
task testNG(type: Test) {
    useTestNG {}
}

test {
    dependsOn testNG
}

However only the JUnit reports are produced. Google again helped me with this link http://ift.tt/1eu0FVS which shows how to solve a problem that looks exactly like mine by configuring two separate test reports folders like below:

testng.testReportDir = file("$buildDir/reports/testng")
test.testReportDir = file("$buildDir/reports/testjunit")

However it does not exactly say where to put those two entries and I feel like I am going to get crazy trying to look at gradle books, gradle examples and API without figuring out how to. According with the API test task has a reports property where you can configure TestTaskReports instance but whatever I tried failed. Can you please help me with this. It must be something so obvious that I am missing it.

Thank you in advance

Aucun commentaire:

Enregistrer un commentaire