Merging test reports

If I have test and integrationTest, which are both of task type Test, by default they will both write to the same area on this, being build/reports/test for the Html report and build/test-results for JUnitXml.

The latter are fine with all of the test results being there. However for the Html report it will only show results from either test or integrationTest depending on which one of the two ran last.

Is there are way of having these merged?

You can use https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.TestReport.html.

I’ve done that, but I was just wondering whether I was missing some obvious.