For the complete documentation index, see llms.txt. This page is also available as Markdown.

Format test reports

Harness CI supports JUnit XML and TRX test report formats.

Results on the Tests tab are parsed from test reports specified in the Report Paths setting in Run and Test steps.

Supported test report formats

Harness supports the following test report formats:

  • JUnit XML — The standard format for test reports. Most testing frameworks either produce JUnit XML by default or have plugins to generate it. Go to JUnit XML format resources for specification details.

  • TRX — .NET test reports (.trx files) are automatically converted to JUnit XML format. When using .NET, enable log reporting when running tests (for example, dotnet test -l:trx) to generate TRX reports.

If your test tool does not produce JUnit XML or TRX by default, go to JUnit converters, formatters, and plugins for conversion tools.

For optimal rendering in the Harness UI, there is a limit of 8,000 characters per field. If a field in your XML file contains more than 8,000 characters, the output might render incorrectly on the Tests tab.


JUnit XML format resources

Use these resources to learn about JUnit XML formatting.

Tools with built-in JUnit XML output

Here are some Harness YAML examples for test tools that produce JUnit XML output by default.

C, C++

CTest Output JUnit

You can use the --output-junit command with CTest.

Java - Gradle

Gradle

Run step:

Test step:

PHP

PHPUnit

Python

For Python, use pytest or unittest. You can also use pytest to run unittest.

Pytest in a Run step

This example runs pytest in a Run step.

If you use test splitting with pytest in a Run step, you must set junit_family=xunit1 in your code repo's pytest.ini file or include -o junit_family="xunit1" in the step's command.

Pytest with Test Intelligence (Test step)

This example runs pytest with Test Intelligence.

Ruby - Cucumber

Cucumber

JUnit converters, formatters, and plugins

If your test tool doesn't automatically produce test results in JUnit XML format, there are JUnit converters, formatters, and plugins available for all major languages. Some examples of conversion tools and corresponding Harness YAML are provided below.

C# - .NET Core, NUnit

Example: NUnit to JUnit

Clojure

Go

Go Junit Report

You can use the go-junit-report tool.

Java - Maven

Maven Surefire Plugin

This example uses the Maven Surefire Plugin.

Run step:

Test step:

JavaScript

ESLint
Jest
Karma
Mocha

Ruby - Minitest, RSpec

Minitest

Add the Minitest Junit Formatter to your Gemfile.

RSpec

Add the RSpec JUnit formatter to your Gemfile.

Code coverage reports and test report artifacts

For information about code coverage reports and publishing report URLs to the Artifacts tab, go to Code Coverage.

Troubleshoot test reports

Go to the CI Knowledge Base for questions and issues related to test reports in Harness CI, including:

Last updated

Was this helpful?