JUnit test results location change between Gradle 2.11 and 3.1?

I’m trying to upgrade from Gradle 2.11 to 3.1 and one thing I noticed is that my JUnit test result XML files are ending up one level deeper in the build tree than they were before. Instead of being in .../test-results/*.xml they’re now in .../test-results/test/*.xml. The part of the path that ends at test-results seems to be configurable using the testResultsDirName property. But I can’t see where the final test pathname component is coming from or whether it can be configured.

I have a bunch of machinery that I’d rather not have to change and that’s assuming the XML files are directly in .../test-results, not a subdirectory.

Anyone have any suggestions?

The “test” path component comes from the task name that creates it. In your case, it is “test”. We hit the same change and we have integration tests run by our own test task called integTest and the XML files are now in “test-results/integTest”. In our case, this change makes sense because before the same test name in test and integTest could overwrite each other. But I don’t know if it could be overwritten.

One quick solution could be to add a finalize step for test that moves these folders back to test-results.

You can configure it to the old behavior using test.reports.junitXml.destination = ...

The change is documented in gradle 3.0 release note.One way to get around this documented in here.