Grails 5 no longer runs my tests!

joemccall86

Joe McCall

Posted on March 21, 2022

Grails 5 no longer runs my tests!

Problem

I just followed the guide to upgrade from Grails 4.0 to Grails 5.1 here. I now try to run my unit and integration tests and Gradle is reporting there are no tests to run!

Solution

In our case, we need to add a new line in build.gradle:

tasks.withType(Test) {
    useJUnitPlatform() // <-- Here
    systemProperty "geb.env", System.getProperty('geb.env')
    systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
    systemProperty "webdriver.chrome.driver", System.getProperty('webdriver.chrome.driver')
    systemProperty "webdriver.gecko.driver", System.getProperty('webdriver.gecko.driver')
}
Enter fullscreen mode Exit fullscreen mode

This tells Gradle that we're using JUnit-style tests.

💖 💪 🙅 🚩
joemccall86
Joe McCall

Posted on March 21, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Grails 5 no longer runs my tests!
grails Grails 5 no longer runs my tests!

March 21, 2022