Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Fail to import test results to XRay Project

Igor Menshikov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 26, 2022

We use Jenkins XRay Plugin to import test results to JIRA XRay project:


step([$class: 'XrayImportBuilder',
endpointName: '/junit',
importFilePath: '**/source/Tests/TestResults/*.xml',
importToSameExecution: 'true',
projectKey: 'TST',
serverInstance: 'nnn',
testEnvironments: 'QA'
])

 


It worked for our initial project but later we decided to create another XRay project with key 'TST'

Now it gives the following error and I do not know what it means:


Starting to import results from test.xml
Error when executing always post condition: hudson.AbortException: Unable to confirm Result of the upload..... Upload Failed! Status:400 Response:{"error":"Project Key and Summary are required to create a new Test"} at com.xpandit.plugins.xrayjenkins.task.XrayImportBuilder.tryUploadResults(XrayImportBuilder.java:828) at com.xpandit.plugins.xrayjenkins.task.XrayImportBuilder.uploadResults(XrayImportBuilder.java:699) at com.xpandit.plugins.xrayjenkins.task.XrayImportBuilder.importResultsSequential(XrayImportBuilder.java:600) at com.xpandit.plugins.xrayjenkins.task.XrayImportBuilder.perform(XrayImportBuilder.java:571) at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:100) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:70) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

It looks like some difference in project configuration but I cannot find it. Google does not help as well.

1 answer

0 votes
Rogério Paiva - Xray Xporter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2022

Hi @Igor Menshikov 

The error message says it needs to have both the Project Key and the Summary set up.

Since the Project Key is set up in the Jenkins pipeline, it should be the summary.

In Xray, there are two ways to set the Summary, explicitly or implicitly.

Explicitly: by using the property "test_summary".

Implicitly: by using the value of the attribute "name" on the "testcase" element of the JUnit report.

Please check this documentation page for additional details: https://docs.getxray.app/display/XRAYCLOUD/Taking+advantage+of+JUnit+XML+reports#TakingadvantageofJUnitXMLreports-Testsummary

Since I assume that you might not be using the property, it should be the attribute "name" that is missing from the JUnit report.

Please check your JUnit report and check this.

If you need further help, please contact Xray Support (http://Xraysupport.getXray.app).

Thank you.

Kind regards,
Rogerio Paiva [Xray Support Team]

Thimmaiah Manjunath
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 9, 2023

Can you please elaborate the steps/procedure to set the summary either way(Explicitly or Implicitly).

The shared documents, didn't helped.

Thank you,

Suggest an answer

Log in or Sign up to answer