Is it possible to use customized junit xml report with a Gradle test task?

I've got a suite of compatibility tests that run multiple times with different dependencies and configurations.  

They use a custom junit runner ( not parameterized runner) , but I want to modify the suite/test name to indicate which environment the particular execution ran in.  

Currently they show as the same test having run repeatedly in TC with no indication which was the failing execution among many successful, without digging into the build log.

I assumed I could use the xml test output in the /build/test-results, and I have a small Gradle task that updates the names there.  I tried configuring the xml reporting build feature to use my customized reports, but it seems to ignore that and continue to use whatever reporting functionality is in the TC Gradle runner.

In suites where I can use the junit4 parameterized runner, I have successfully customized the name with info from the parameters, but modifying the custom runner to make it parameterized would require a lot more effort than simply modifying the xml output.

Is it possible to have a TC Gradle build configuration use customized xml report output ?

1 comment

Hello Gigi,

TC Gradle runner does not rely on xml report output, but instead uses Gradle TestListener API ( https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/TestListener.html ).

So you have two options:
* Customize your junit runner so that Gradle sends correct data using TestListener API
* Use command line runner instead of Gradle runner, call "gradlew" script and enable Xml Report Processing build feature.

0

Please sign in to leave a comment.