-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot publish results to xray jira #6
Comments
Could you try install version 0.1.2? I fixed a bug with wrong endpoint for cloud sever. |
Hi, requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://xray.cloud.getxray.app/api/v2/import/execution |
There is only the bearer authentication implemented so far. It seems you need a token authentication. |
We are implementing (Bearer authentication) as on the document
Is this the right way ? (we set up the client id and the secret on our environment variables with in the pipeline)* HTTPError: Could not post to JIRA service at https://xray.cloud.getxray.app/api/v2/import/execution. Response status code: 401 |
If you are using token authentication for your Jira server you should generate it from Jira account configuration. And then you should use it instead of client id and secret. Can you try install package from branch
And let me know if it helped. |
I get this error now yaml file -
|
@fundakol I experienced the same issue using Jira Cloud and have traced it down to
I don't know if this was because of something peculiar in my organisation's setup though, given that this worked for you. |
Thanks @kconkas for point this out, I will fix it. |
@fundakol has this issue been resolved yet? |
@BlacktoBlue did you observe the issue? If so can you provide some details like what authentication you are using, and it is Jira cloud or not? |
I have managed to get a different error than this:
I believe that the authentication is working in v0.2.0, as I initally started with the wrong url, and now that is corrected it seems to be going to the xray api. |
Ignore the above this is now all working fine. I had selected the wrong item in Jira for the scenario to be linked to. |
I have set my system environments (Bearer authentication) for Xray Cloud:
(Yes, i have set them on the pipeline environmental variables)
export XRAY_API_BASE_URL= "https://xray.cloud.getxray.app"
export XRAY_CLIENT_ID=
export XRAY_CLIENT_SECRET=
Using the command "- behave -f allure_behave.formatter:AllureFormatter -o report/allure/results -f pretty --f xray ./features/" I am running the test
And on the Feature file I have added the Test execution at the top followed by test case if for the scenario
Feature file:
@jira.test_execution('TEST-xxx')
Feature: feature name
Background: Common Steps
Given xxx
@jira.testcase('TEST-xxxx')
Scenario: Scenario name
On the pipeline I get below error -
HTTPError: Could not post to JIRA service https://xray.cloud.getxray.app/. Response status code: 404
Exception JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/behave", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/behave/main.py", line 183, in main
return run_behave(config)
File "/usr/local/lib/python3.10/site-packages/behave/main.py", line 127, in run_behave
failed = runner.run()
File "/usr/local/lib/python3.10/site-packages/behave/runner.py", line 804, in run
return self.run_with_paths()
File "/usr/local/lib/python3.10/site-packages/behave/runner.py", line 824, in run_with_paths
return self.run_model()
File "/usr/local/lib/python3.10/site-packages/behave/runner.py", line 626, in run_model
failed = feature.run(self)
File "/usr/local/lib/python3.10/site-packages/behave/model.py", line 350, in run
formatter.eof()
File "/usr/local/lib/python3.10/site-packages/behave_xray/formatter.py", line 127, in eof
self.xray_publisher.publish(self.test_execution.as_dict())
File "/usr/local/lib/python3.10/site-packages/behave_xray/xray_publisher.py", line 51, in publish
result = self.publish_xray_results(self.endpoint_url, self.auth, test_execution)
File "/usr/local/lib/python3.10/site-packages/behave_xray/xray_publisher.py", line 45, in publish_xray_results
_logger.error('Response error: %s', response.json())
File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The text was updated successfully, but these errors were encountered: