Xray-App / xray-junit-extensions

Enhanced JUnit 5 integration with Xray Test Management for Jira
Eclipse Public License 2.0
16 stars 8 forks source link

Sett Fix version on the Text Execution Key and Create a Test plan #26

Closed InduKrish closed 1 year ago

InduKrish commented 1 year ago

To produce better reporting in JIRA, we would like to add a fix version every time a new text execution is created.

We found your plugin helpful and run our project using it, and would like to clarify if there is a way to update a fix version on the text execution everytime the test runs in the pipeline. and also would like to create a Test plan .

Is there a way to automatically create the test plan using the plugin?

Currently we are using @Requirement and @XrayTest tags , Please advise how i can have a fix version added to all the test executions and if there is a way to automatically create the test plan and associate all test executions to the test plan? Thank you!

@Test @Requirement({"BECB-329", "BECB-220", "BECB-274"}) @XrayTest(key = "BEXP-73") @DisplayName("Validate bases end points ") public void test105_crewBasesCrewInFlight() {

}
bitcoder commented 1 year ago

Hi, the fixversion and other information such as the Test Plan key, is not stored on the JUnit XML report. That information is passed whenever submiting the report file, i.e., on the HTTP REST api call as seen on this example: https://docs.getxray.app/display/XRAY/Import+Execution+Results+-+REST#ImportExecutionResultsREST-JUnitXMLresults

So, it's out of scope of this plugin.

InduKrish commented 1 year ago

just to make that i understand correctly. Are you advising that i should be using the Junit xml report that the Xray plugin produces and use the following api and query params? Referred the link given above. https://docs.getxray.app/display/XRAY/Import+Execution+Results+-+REST#ImportExecutionResultsREST-JUnitXMLresults

This is the command we currently use: XRAY_COMMAND: 'curl -H "Content-Type: multipart/form-data" -u $JIRA_USER:$JIRA_PASSWORD -F "file=@test-functional/target/${XRAY_REPORT}" "$JIRA_SERVER_URL_PROD/rest/raven/1.0/import/execution/junit?projectKey=BDXP"'

These are the annotations i currently use. this will automatically create test executions and map all the tests to all the requirements mentioned below, ie BACB-329", "BACB-220", "BACB-274. using your plugin. @Test @Requirement({"BACB-329", "BACB-220", "BACB-274"}) @XrayTest(key = "BDXP-73") @DisplayName("Validate crew.")

Like i mentioned above, now i would like to update fix version nos' in all the text executions that are automatically created and add all the tests to the test plan..

POST /rest/raven/1.0/import/execution/junit -->Should I pass Test Plan and fix version as a query params and submit the same JUNIT xml that the Xray plugin produces? Will the api add the fix revision number to all test executions that xray plugin automatically creates in JIRA and all the Xary tests to the test plan id that i pass as a query param?

Can you please confirm? curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@report.xml" http://yourserver/rest/raven/1.0/import/execution/junit?projectKey=XTP&testPlanKey=XTP-12&revision=v2.1.0

bitcoder commented 1 year ago

Yes exactly. You need to pass those attributes not on the report itself but on the API call as query parameters. It will create a Test Execution issues with the given fixversion, the given revision, and the given testplan.

bitcoder commented 1 year ago

I'll close this ticket as this is out-of-scope of this extension; for questions related with Xray API usage, please reach out Xray support team.