Publish CI test results

3 minute read

Publish test results from your CloudBees CI or Jenkins® Pipeline to CloudBees Unify to view and manage all testing information in one place. Configure your integrated CI Pipeline to send test results, then drill down through test suites and test cases to view each test status, run time, and log output.

Before you begin, ensure you have completed the CI or Jenkins integration. For setup instructions, refer to Connect CI and Jenkins controllers.

Configure your Multibranch Pipeline to publish test results

Publish your CI Pipeline test results to CloudBees Unify to leverage its enhanced analytics and quality gates.

To enable publishing test results from your CI build to CloudBees Unify:

  1. Integrate your controller or operations center with CloudBees Unify by completing the steps in Connect CI and Jenkins controllers.

  2. Install the JUnit plugin on your controller.

  3. Configure the plugin on the job level by adding a Publish JUnit test result report in a Post-build Action.

  4. Specify the path to your test result XML files in your Jenkinsfile, as in the following example:

    pipeline { agent any stages { stage('Test') { steps { junit '**/testing/my-reports/*.xml' } } } }
  5. Include tests on your Pipeline that generate results in JUnit XML output format, according to the instructions in the table below.

Configure test tools for JUnit XML output

Configure your test tools to generate reports in JUnit XML format:

Table 1. Supported test tools
Test tool How to generate reports in JUnit XML format

Appium

JUnit XML format by default

CTest

ctest --test-dir build --output-junit out.xml

Cucumber

--format junit

Cypress

cypress.config.js file: { "reporter": "junit" }

Espresso

JUnit XML format by default

Go

go test -v 2>&1 ./…​ | go-junit-report -set-exit-code > report.xml

Jest

reporters=default --reporters=jest-junit

JUnit

JUnit XML format by default

Minitest

bundle exec rake test --junit

Mocha

mocha test --reporter mocha-junit-reporter

Playwright

Configure and specify the output file name in playwright.config.js.

Pytest

pytest --junitxml=report.xml

PHPUnit

./tests --log-junit junit.xml

Selenium

Does not directly generate JUnit XML (integrate with other testing frameworks).

TestNG

Add the org.testng.reporters.JUnitReportReporter listener to the TestNG suite.

Once you have set up your Pipeline to publish test results, this configuration also enables the Test insights dashboard, which provides a comprehensive view of test metrics for your CI projects. For more information, refer to Test insights.

View your CI build test results

Display test results from your CI build in the same platform as all your other DevOps projects.

To view the test results for a build:

  1. Access the details for your CI build:

    1. Select the organization and component associated with the CI build.

    2. Select Components  Runs.

    3. Select the build name to view build details.

  2. Select Test results, and then select a viewing option.

The test suites or test cases are displayed accordingly. For more information, refer to Test results.

Test suites view

The TEST SUITES view displays: * Test suite names and hierarchy * Total number of tests per suite * Pass/fail status for each suite * Execution time for each suite * Overall success rate

Test cases view

The TEST CASES view displays: * Individual test case names * Pass/fail/skip status for each test * Execution time per test * Error messages for failed tests * Stack traces and log output when available

Troubleshooting

Test results not appearing

Verify the following:

  • The JUnit plugin is installed and active on your controller.

  • Your test tool is generating JUnit XML format output.

  • The path pattern in your Jenkinsfile matches the location of your test result files.

  • The build has appropriate permissions to read the test result files.

Incomplete test results

Check that:

  • All test result files are generated before the junit step executes.

  • The file pattern includes all test result locations.

  • Test result files are valid JUnit XML format.

Test results show in controller but not in CloudBees Unify

Ensure:

  • The controller integration is connected and active.

  • The build completed after the integration was established.

  • The controller has network access to send data to CloudBees Unify.