Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Xray does not provide a specific plugin for Concourse. However, similarly to CircleCI, Gitlab and other tools, it is easy to configure a pipeline and integrate it with Xray.

For this, you may simply take advantage of Xray's REST API for submitting results for example.


Table of Contents

JUnit example

In this scenario, we want to get visibility of the automated test results from some tests implemented in Java, using the JUnit framework. 

...

Note that this file is just an example; you should avoid hardcoded usernames, passwords in the .yml file.

In order to submit test results, we'll just need to invoke the REST API (as detailed in Import Execution Results - REST).

We're using "curl" utility that comes in Unix based OS'es but you can easily use another tool to make the HTTP request; however, "curl" is provided in most Docker images.


Info
titlePlease note

The Jira user (i.e. username and password) mentioned in the configuration below must exist in the Jira instance and have permission to Create Test and Test Execution Issues.


After preparing the pipeline configuration file, it needs to be submitted to Concourse.

...

You can open your browser (e.g. http://127.0.0.1:8080/teams/main/pipelines/java-junit-calc/jobs/tests/) and execute/check the execution progress there.


Image Added


And in Xray, in this caseIn order to submit those results, we'll just need to invoke the REST API (as detailed in Import Execution Results - REST).

Info
titlePlease note

The Jira user (i.e. username and password) mentioned in the configuration below must exist in the Jira instance and have permission to Create Test and Test Execution Issues.

Image Removed

In.circleci/config.yml a "step" must be included that will use "curl" in order to submit the results to the REST API.

curl -H "Content-Type: multipart/form-data" -u $jira_user:$jira_password -F "file=@target/surefire-reports/TEST-com.xpand.java.CalcTest.xml" "$jira_server_url/rest/raven/1.0/import/execution/junit?projectKey=CALC"

have a new Test Execution containing the results of the automated tests.


Image AddedWe're using "curl" utility that comes in Unix based OS'es but you can easily use another tool to make the HTTP request; however, "curl" is provided in the container used by CircleCI.

References