Show error message when failing to upload to help with debugging
LauraArmitage opened this issue · 1 comments
LauraArmitage commented
I have been getting a 400 bad request error message and struggled to understand why. When I have managed to make the import request by POSTing directly to the URL I have realised there is a helpful error message returned. It would be good for this to be displayed when the github action runs
Use of action:
- name: Submit results to Xray
uses: mikepenz/xray-action@v2.4.5
with:
username: ${{ secrets.XRAY_CLIENT_ID }}
password: ${{ secrets.XRAY_CLIENT_SECRET }}
testPaths: ${{ env.TRI }}/test-report.xml
projectKey: "jira-ticket-no"
failOnImportError: true
continueOnImportError: false
Example logs from github action (with debug logging):
##[debug]Try to import: /home/runner/work/my-repository-name/my-repository-name/path/test-report.xml
##[debug]Using endpoint: https://xray.cloud.getxray.app//api/v2/import/execution/junit
Warning: 🔥 Failed to import: /home/runner/work/my-repository-name/my-repository-name/path/test-report.xml (Response code 400 (Bad Request))
ℹ️ Processed 0 of 1 elements. Failed to import: 1
Error: 🔥 1 failed imports detected
(I assume the double slash in the url is a red herring)
Result from hitting the url in Postman:
{
"error": "Error retrieving Project from Jira with key \"jira-ticket-no\": No project could be found with key 'jira-ticket-no'."
}
Could the error message returned from xray be passed on to the Github action logs?
mikepenz commented
Thank you very much for the suggestion. will be in the next release