I'm using xray-action in my maven.yml file and mentioned the testng results in that.
Below is the error I get in the github actions workflow build while trying to import testng-results.xml.
P.S The path mentioned in the error is correct one
FYI: This is the documentation I followed https://docs.getxray.app/display/XRAYCLOUD/Integration+with+GitHub
Hi @Meghana Mallineni and welcome to the community,
Could you please share your API call from your yml that should do the import?
Best
Stefan
steps:
- uses: actions/checkout@v2
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: clean build folders
run: mvn clean
- name: Build with Maven
run: mvn test
- name: Submit results to Xray
uses: mikepenz/xray-action@v2.3.0
if: always()
with:
username: ${{ secrets.jira_username }}
password: ${{ secrets.jira_password }}
testFormat: "testng"
testPaths: "**/surefire-reports/TEST-TestSuite.xml"
projectKey: "CT"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see. tbh: I‘m more familiar with importing test results with built in API.
I did a quick research and found this:
https://github.com/mikepenz/xray-action
according to this documentation the call requires an testExec parameter which I could not find in your yml.
Please try to add this option and let us know the result.
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried another way too,
Run curl -H "Content-Type: text/xml" -X POST -H "Authorization: ***" --data @target/surefire-reports/testng-results.xml "https://xray.cloud.getxray.app/api/v2/import/execution/testng?projectKey=CT"
This is getting timeout.
{"error":"Import results request timed out! The import task is still running on the background."}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you check these docs:
https://docs.getxray.app/display/XRAY/Import+Execution+Results+-+REST#ImportExecutionResultsREST-TestNGXMLresults
https://docs.getxray.app/display/XRAY/Taking+advantage+of+TestNG+XML+reports
Don´t ask me why but the docu says to use "Content-Type: multipart/form-data":
curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" http://yourserver/rest/raven/1.0/import/execution/testng?projectKey=XTP
Furthermore:
Xray supports TestNG 6.14 XML reports.
And:
Are you using the standard TestNG reporter or any other xml reporter (like eg. JUnit)?
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No worries, I'm using surefire-reports, results are present in this folder
"target/surefire-reports/testng-results.xml
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just checked against my yml file where I import JUnit-xml.
There is a difference that I then also checked and found in the docu:
The docu has the file part in quotes but not the URL. In your call it´s exactly the other way round. So I would suggest to try the following:
curl -H "Content-Type: text/xml" -X POST -H "Authorization: ***" --data @"target/surefire-reports/testng-results.xml" https://xray.cloud.getxray.app/api/v2/import/execution/testng?projectKey=CT
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I´m not sure about the different formats of reporters.
Xray documentation mainly pointing out the one that are supported but I couldn´t find surefire. In case it doesn´t work I could imagine this has something to with the reporter´s format. If so I would suggest to rather change the reporter (TestNG standard or JUnit) or contact the vendor´s support.
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried to upload surefire xml file manually in the Test Execution issue Type in Xray and It didn't get uploaded. Looks like there's some problem with the xml file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it mandatory to give the testExecKey in the curl command ? If so should we create a Test Execution Issue type before running the curl command ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
as far as I know: the testExecKey is not mandatory (as long as there is the projectKey provided). If the project key is provided a new test execution is created with the results.
Nevertheless you could give it a shot if this works in your case.
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.