jenkinsci / xray-connector-plugin

Xray Test Management Connector for Jenkins
https://plugins.jenkins.io/xray-connector/
MIT License
16 stars 13 forks source link

Pipelines get Xray: Build Enviroment Variables #15

Closed StefanIricinschi closed 4 years ago

StefanIricinschi commented 4 years ago

Hello, Right now there is an issue when Pipeline job is used with Xray environment variables. Is no way to get the following variables XRAY_IS_REQUEST_SUCCESSFUL,XRAY_ISSUES_MODIFIED,XRAY_RAW_RESPONSE,XRAY_TEST_EXECS,XRAY_TEST Please make these variables accessible. I could think of several ways: 1) Make these environment variables 2) Make them work on pipelines 3) Return them as step result Thank you,

Russell616 commented 4 years ago

Hi!

Thank you for your interest in the Xray connector plugin :) Unfortunately, our injection environment variables is not compatible with Pipeline jobs, as described in our documentation.

Regarding your suggestions: 1) These variable are already set as environment variables on a node level in Freestyle projects, unfortunately, this is not possible to be done at Pipeline jobs at this moment (see reason on the next point).

2) This limitation is due to how Jenkins itself handles the variable injection (if you want, I can provide some technical details). As such, this limitation is not exclusive form our plugin, for example, you can take a look at other popular plugin repository, the envinjector, and go to the Jenkins Pipeline compatibility section. If you really need to extract information from the server response, the best is to use a curl call to the Xray REST API to import the results and then parse the response, or to continue to use the plugin step and parse the log file of the current build.

3) Can you provide an example how these variable could be returned as a Step Result?

Thank you!