I am facing this issue that when there are large number of tests and test task runs for longer duration, then Gradle test task does not generate TestNG reports (emailable-report.html, testng-results.xml, as well as junitreports and other TestNG related JS and CSS files). I am expecting it to be generated under build/reports/tests/test/
path but any TestNG related files are not created.
I am using following version of dependencies:-
- TestNG 7.10.1
- Gradle 8.5
- JDK 17
I am running tests with gradle clean test
. Here is how I have already enabled listeners in my build.gradle to produce testng reports:-
test {
useTestNG() {
useDefaultListeners = true
}
}
Additional Context:-
Intrestingly this issue does not happen if I only run a subset of smoke tests rather than running a whole regression test suite which takes longer (above 1 hour with 60+ tests). As you can see from the screenshot of build directory, there is no TestNG related XML, HTML, and other asserts.
I am attaching the link to Gradle debug logs as well:
gradle-debug-logs-gist
I am assuming that this happens because somehow Gradle task interferes with the TestNG reports creation resulting in overwriting or deletion of the TestNG reports. I am not sure whether disabling the Gradle report will resolve this issue and how should this be done?
Does anyone know if there is a way to properly generate TestNG reports with Gradle? I need this testng-results.xml for further processing but I am unable to generate it if I run a larger regression suite.