X-ray JUnit XML Multipart is not accepting mutiple xml files

Akshatha Ramesh May 22, 2023

sample_test1.feature -

Feature: Sample feature1
 
    @test_jiraID-123
    @label_sampleFeature1
    Scenario: Testing1
        When the Component is a TEST

    @test_jiraID-456
    @label_sampleFeature1
    Scenario: Testing2
        When the Component is a TEST

sample_test2.feature -

Feature: Sample feature2

    @test_jiraID-789
    @label_sampleFeature2
    Scenario: Testing3
        When the Component is a TEST

Radish command -

radish --cucumber-json=sample_test.json --junit-xml=xmlreport/sample_test1.xml sample_test1.feature -b test/
radish --cucumber-json=sample2_test.json --junit-xml=xmlreport/sample_test2.xml sample_test2.feature -b test/

the output of the above command will create two XML files:

ls xmlreport/
sample_test1.xml
sample_test2.xml

I have a stage in Jenkins - which does this -

    stage('Import results to Xray') {
    steps {
        step([$class: 'XrayImportBuilder', endpointName: '/junit/multipart', importFilePath: 'xmlreport/*.xml', credentialId: "${JIRA_USER_ID}", projectKey: 'TEST', serverInstance: '<myserver>', testEnvironments: 'TEST', importToSameExecution: "true", importInParallel: "false", importInfo: 'Jenkins/XrayTestExecutionImportInfo.json', testImportInfo: 'Jenkins/XrayTestImportInfo.json', inputInfoSwitcher: 'filePath', inputTestInfoSwitcher: 'filePath' ])        
          }
        }  

XrayTestImportInfo.json :

{
    "fields": {
    "description": "Automated Test",  
        "labels": [
               "Testing",
               "Automation"
                ]
              }
}

Output of Jenkins Console:

Successfully imported JUnit XML multipart results from sample_test1.xml
Successfully imported JUnit XML results from sample_test2.xml

I see that all the jira IDs present in sample_test1.xml (jiraID-123,jiraID-456) are updated with the contents in XrayTestImportInfo.json. But, the jira IDs in sample_test2.xml (jiraID-789) do not get updated.

 

I have also tried:

curl -H "Content-Type: multipart/form-data" -F "file1=@sample_test1.xml" -F "file2=@sample_test2.xml"  -u user:pass -F "info=@XrayTestExecutionImportInfo.json" -F "testInfo=@XrayTestImportInfo.json" https://<sever>/junit/multipart

{"error": "The results file is required."}

0 answers

Suggest an answer

Log in or Sign up to answer