karatelabs / karate

Test Automation Made Simple
https://karatelabs.github.io/karate
MIT License
8.24k stars 1.94k forks source link

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

Open BG04129 opened 3 months ago

BG04129 commented 3 months ago

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

ptrthomas commented 3 months ago

@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