Skip to content
Merges multiple JUnit XML files into a single testsuites XML file.
Java
Branch: master
Clone or download
Latest commit d82dade Jul 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src 1.0.1 handle not so well formed testsuites Oct 4, 2017
.editorconfig initial structure Sep 8, 2017
.gitignore
DEVELOPMENT.md basic parser code Sep 8, 2017
Jenkinsfile basic parser code Sep 8, 2017
LICENSE v1.0.0 done with 100% coverage Sep 9, 2017
README.md Update README.md Jul 23, 2019
pom.xml 1.0.1 handle not so well formed testsuites Oct 4, 2017

README.md

Java JUnit XML Merger

Merges multiple JUnit XML files into a single testsuites XML file. Simply combine your test results from different test runners.

 

Is this for me?

You have multiple XML files that look like this:

<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="23" failures="0" name="foo.BarUnitTest" time="4.20" errors="0" skipped="0">
  <!-- foo -->
</testsuite>

And you want a single file that looks like this:

<?xml version="1.0" encoding="UTF-8" ?>
<testsuites name="My Suite" time="6.60" tests="26" failures="0">
  <testsuite tests="23" failures="0" name="foo.BarUnitTest" time="4.20" errors="0" skipped="0">
    <!-- foo -->
  </testsuite>
  <testsuite tests="3" failures="0" name="bar.FooUnitTest" time="2.40" errors="0" skipped="0">
    <!-- bar -->
  </testsuite>
</testsuites>

then this is for you


 

Usage

With folder src/test/resources/ containing multiple *.xml files in junit-xml format. A combined result will be written to output.xml. The Suite name will be My Suite.

# INSTALL
curl -L -o junit-xml-merger.jar \
     https://github.com/codeclou/java-junit-xml-merger/releases/download/1.0.1/junit-xml-merger.jar

# RUN
java -jar junit-xml-merger.jar \
     -i=src/test/resources/ \
     -o=output.xml \
     -s="My Suite"

 

Demo

git clone https://github.com/codeclou/java-junit-xml-merger.git src
cd src

curl -L -o junit-xml-merger.jar \
     https://github.com/codeclou/java-junit-xml-merger/releases/download/1.0.1/junit-xml-merger.jar

java -jar junit-xml-merger.jar \
     -i=src/test/resources/ \
     -o=output.xml \
     -s="My Suite"

# Show result
xmllint --format output.xml | pygmentize

 

License

MIT © Bernhard Grünewaldt

You can’t perform that action at this time.