karatelabs/karate

Combine multiple JUnit XML files from reports folder into single XML file

Opened this issue · 2 comments

For my test workflow with Karate, it is necessary to merge all JUnit XML reports into a single file.

By default, Karate generates a JUnit report with the following structure for each FEATURE file:

<testsuite>
	<testcase>
		<!-- CONTENT -->
	</testcase>
</testsuite>

The target structure I need is to collect all JUnit reports in in a single file:

<testsuites>
	<testsuite>
		<testcase>
			<!-- CONTENT feature#1 -->
		</testcase>
	</testsuite>
	<testsuite>
		<testcase>
			<!-- CONTENT feature#2 -->
		</testcase>
	</testsuite>
	<!-- etc. -->	
</testsuites>

Is there a switch in Karate that merges all generated JUnit XML reports?

If this function has not yet been implemented, is there any chance to add this feature in a upcoming release?

Thanks in advance

@BG04129 in our experience, most CI tools can merge the JUnit XML files automatically and this need has never come up before. this is unlikely to get implemented, but I will keep this open for a while in case someone is interested in contributinig

Xray upload is only dealing with one xml file per upload. We worked around it with a shell script