Surefire report output transform Icon Surefire report output

Description

The Surefire report output transform turns rows with test results into a Maven Surefire XML report, the JUnit format that CI servers such as Jenkins and GitLab read. Each row becomes one test case.

The report is written when the last row has arrived. The rows pass through unchanged, so the transform can sit in the middle of a pipeline.

Options

Option Description

Transform name

Name of the transform.

Report filename

The XML file to write. Variables are allowed.

Test suite name

The name of the test suite in the report. Default: tests.

Create parent folder

Create the folder of the report file when it doesn’t exist.

Test name field

The field with the name of the test. Required. The value is shortened: everything up to the last / or \, a main- or main_ prefix and a .hwf extension are removed, so /project/tests/main-load-orders.hwf becomes load-orders.

Duration field

The field with the duration of the test, in seconds.

Duration is in milliseconds

The duration field is in milliseconds, for example the ExecutionTime of a Workflow executor.

Result field

The field with the result of the test. Without it, every test passes.

  • Boolean: true passes.

  • Number: 0 passes, any other number fails.

  • Text: PASS, PASSED, SUCCESS, OK, Y, YES or TRUE passes, SKIP or SKIPPED is skipped, and ERROR is an error. Upper or lower case doesn’t matter.

Any other value, or an empty one, fails.

System-out field

The field with the log of the test, for example the ExecutionLogText of a Workflow executor.

System-err field

The field with the error output of the test.

Failure message field

The message of a failed, errored or skipped test.

Failure type field

The type of a failed or errored test. Default: the test name.

Fail pipeline on test failure

After writing the report, stop the pipeline with an error when a test failed or had an error.

Example: a report for a folder of test workflows

Hop’s own integration tests use this transform to report their results to Jenkins, in run-project-tests.hpl:

The run-project-tests pipeline: get main workflows
  1. Get file names lists the workflows of the project whose name starts with main, including its subfolders.

  2. Workflow executor runs each of these workflows, through a small workflow that gets the file name as a parameter, and sends the execution results to the Surefire report output transform.

  3. Surefire report output uses filename as the test name field, ExecutionTime as the duration field (in milliseconds), ExecutionResult as the result field, and ExecutionLogText as the system-out field. Fail pipeline on test failure is on, so a failed test also ends the pipeline with an error.

For main-load-customers.hwf, which succeeds, and main-load-orders.hwf, which ends with an Abort action, the report looks like this (the logs are shortened):

xml
<testsuite ... version="3.0" name="my-project" time="0.131" tests="2" errors="0" skipped="0" failures="1">
<testcase name="load-customers" time="0.071">
<system-out>
<![CDATA[2026/11/06 11:49:07 - run-workflow - Start of workflow execution
...
]]>
</system-out>
</testcase>
<testcase name="load-orders" time="0.060">
<failure type="load-orders"></failure>
<system-out>
<![CDATA[2026/11/06 11:49:07 - run-workflow - Start of workflow execution
...
2026/11/06 11:49:07 - Abort - ERROR: stop
...
]]>
</system-out>
</testcase>
</testsuite>

Notes

  • Run the transform in one copy. Each copy writes its own report to the same file, so with more copies the report misses tests, or the transform fails.

  • The report filename is a local file path. VFS locations such as s3:// or file:// URLs are not supported.

  • ANSI color codes and characters that XML can’t hold are removed from the texts in the report.

Samples

The samples project has transforms/surefire-report-output.hpl, which writes a report for two tests from a Data grid.