Test reporting in Pipelines

You can now visualize your tests results in an easy way and quickly identify failed tests in your build. Test reporting will be automatically enabled in your pipeline when it detects xUnit-compatible test results.

How Test reporting works

If your build step generates test results, Pipelines will automatically detect and visualize them in the web interface. Pipelines can work fine with any XML xUnit-compatible test reports, independently of the language they are written in. 

Any user with read access to the repository can view the test results in the pipelines log panel. If failed test results are found, the log view will change to highlight the failed tests, showing the reason and the stack-trace if present. Still, the full log view would be available using the log panel dropdown, which allows to switch between the full log and test reporting views.

Configuring Test reporting

In order to enable Test Reporting, you just need to make sure that build test reports are generated in one of the following supported default locations (with a directory depth of 3 levels):


The test report file scanner will begin searching from the base directory of your build: /opt/atlassian/pipelines/agent/build

Configuring test runners

Maven Surefire / Failsafe plugins

For Maven build jobs, no special configuration is required if you are using Maven Surefire Plugin or Maven Failsafe Plugin. The reports would be automatically generated when the unit or integration maven test goals are executed.


For Gradle builds, test reports are automatically generated in XML xUnit-compatible format. No special configuration is required as, by default, Gradle generates the test results in one of the default locations.


For PHPUnit test reports, you should explicitly specify the --log-junit parameter to generate the test reports output to a particular location.

image: php:7.1.1
    - step:
          - apt-get update && apt-get install -y unzip
          - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
          - composer require phpunit/phpunit
          - vendor/bin/phpunit --log-junit ./test-reports/junit.xml

Mocha for Node.js

For Mocha test framework, you can use the mocha-junit-reporter and configure the output file where the test report will be generated. 

image: node:6
    - step:
		  - npm install mocha
          - mocha test --reporter mocha-junit-reporter --reporter-options mochaFile=./test-reports/junit.xml

Unittest for Python

For Python Unittest framework you can use the unittest-xml-reporting module when configuring the tests, adding the XMLTestRunner in your test configuration.

import unittest
import xmlrunner

class TestExample(unittest.TestCase):
    def testIsTrue(self):

if __name__ == '__main__':

Other test runners

For other test runners just make sure that the XML xUnit-compatible test results are generated as a part of your build in one of the default supported locations.

最終更新日 2018 年 3 月 7 日


Powered by Confluence and Scroll Viewport.