The TestReport.reportOn(Object…) method has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the testResults method instead. See TestReport - Gradle DSL Version 7.4 for more details.
The documentation is not clear though. I can’t just swap reportOn out for testResults, and there seems to be more involved given the section the error links to.
The DSL it links to and also the JavaDoc are pretty clear, aren’t they?
They say
use TestReport.getTestResults() and invoke ConfigurableFileCollection.from(java.lang.Object[]) instead, passing references to AbstractTestTask.getBinaryResultsDirectory() as arguments.
In Gradle 8.5, I’ve removed the following snippet from my parent build.gradle:
task testReport(type: TestReport) {
destinationDir = file("./reports/allTests")
// Include the results from the `test` task in all subprojects
reportOn subprojects*.test
}
and created a separate subproject, say test-results, with the following build.gradle: