Documentation

JUnit XML format support for CI test reports

JUnit XML comes in many dialects, and TestNod reads the elements and attributes that virtually every test runner produces. Anything else is ignored rather than rejected, so a report with vendor-specific extensions still uploads cleanly.

Document structure

TestNod accepts the standard <testsuites> and <testsuite> root forms. Both single-suite and multi-suite documents work:

<testsuites>
  <testsuite name="UserSpec" tests="3" failures="1" errors="0" skipped="1" time="0.42">
    <testcase classname="UserSpec" name="creates a user" time="0.10"/>
    <testcase classname="UserSpec" name="rejects invalid emails" time="0.12">
      <failure type="RSpec::Expectations::ExpectationNotMetError" message="expected: false">
        ...
      </failure>
    </testcase>
    <testcase classname="UserSpec" name="future feature" time="0.00">
      <skipped/>
    </testcase>
  </testsuite>
</testsuites>

Elements TestNod reads

Element What's used
<testsuite> name becomes the suite name. time is read for suite duration when present, otherwise summed from cases.
<testcase> classname and name together form the case identity used for diffs and failure clustering. time is the per-case duration.
<failure> Marks the case as failed. type and message are stored and feed the failure signature. The element body is stored as the failure trace.
<error> Marks the case as errored (test setup blew up rather than an assertion failing). Same fields as <failure>.
<skipped> Marks the case as skipped. Skipped counts feed the skipped test count creep alert. TestNod also tracks how long each skipped case has gone without running for the stale skipped tests alert, and What Changed lists cases that started or stopped being skipped.
<flakyFailure>, <flakyError> Maven Surefire adds one for each failed attempt when a rerun passes. The case is marked passed on retry, and the last element's type, message, and stack trace are stored as its failure or error. See Maven Surefire flaky test reruns.
<system-out>, <system-err> Stored as the test suite's captured output and shown on the test suite detail panel.
<properties> Each child <property> is stored as a name/value pair and shown on the test suite detail panel.

How TestNod resolves test status

Each <testcase> resolves to exactly one status, in this priority order:

  1. <failure> present → failed
  2. <error> present → errored
  3. <skipped> present → skipped
  4. <flakyFailure> or <flakyError> present → passed on retry
  5. Otherwise → passed

A case with both <failure> and <error> is recorded as failed.

TestNod also sets passed on retry after looking at every entry for the same test. When the same test appears more than once in a build and its last attempt passed after an earlier one failed or errored, TestNod keeps one entry with that status. Retries and reruns explains when this happens and how to send rerun files.

Identity for diffs and clustering

Two test cases are "the same case across runs" when their classname and name match exactly, including whitespace. If your test runner mangles either value across runs (some Jest configurations include a path with a hash, for example), comparisons and clustering will treat them as different cases. The fix is to stabilize the identity in the runner.

What's ignored

These show up in some dialects and are dropped:

  • Custom attributes on <testsuite> or <testcase> beyond the ones listed above.
  • Vendor-specific elements other than Surefire's <flakyFailure> and <flakyError>. Surefire's <rerunFailure> and <rerunError> are dropped too, and the test keeps the status from its <failure> or <error>.
  • XML comments and processing instructions.

If you depend on a field that TestNod ignores, email [email protected] and the TestNod team will look at supporting it.

Character encoding

TestNod expects UTF-8 input. Most runners default to UTF-8, but some Java tools emit UTF-16 with a BOM, so convert those reports to UTF-8 before upload if you see encoding errors during parsing.

Try TestNod during early access

Early access is free, and when paid plans launch your team gets 50% off the Team plan for a year. Leave your email and we'll send you an invite. We can also help you set up the CI step.

We'll only use this address to email you about TestNod.