Using test.single appears to be deprecated. The new correct way to do this is
./gradlew :<module>:test --tests <pattern>
where <pattern> could be something like:
com.example.MyTestto run all test methods in com.example.MyTest*MyTestto match every method in every class whose name ends with MyTest*.MyTest.myMethodto run a specific test method in class MyTest in any package
If you have a multi-project build, make sure to give the module path before the test task; otherwise you’ll get a misleading error message when it searches for your test pattern in every subproject.
None of this is documented on the Gradle site anywhere I could find it.