RedHatQE / pylero

Python wrapper for the Polarion WSDL API
https://redhatqe.github.io/pylero/
MIT License
37 stars 25 forks source link

Need a way to set new custom fields on Test Records #41

Open brian12559 opened 3 years ago

brian12559 commented 3 years ago

In version 21R1 Polarion introduced custom fields on Test Records. This is a very useful feature and critical to us implementing TFA in Polarion. Here is the new help on it: (.polarion/help/index.jsp?tab=links&contextId=com.polarion.xray.web.test_record_custom_fields)

Here is API for Test Record...not sure if it is supported yet..I have posed the question to Siemens

brian12559 commented 3 years ago

here's some info from Siemens: There are methods in our API - you can add a property to a test record, get it, and delete it:

ITestRecord.getProperty() ITestRecord.setProperty() ITestRecord.removeProperty()

Here's more information about the ITestRecord method: https://almdemo.polarion.com/polarion/sdk/doc/javadoc/com/polarion/alm/tracker/model/ITestRecord.html.

leelavg commented 3 years ago

@brian12559

@simzacks my understanding is even if we run methods/functions on any object the result will end up in _cls_suds_map and I was not able to figure out where to store the properties of custom fields on TestRecord.

Am I missing anything here?

brian12559 commented 3 years ago

custom fields are added to a Projects Test Run here:

/polarion/#/project/Polarion/administration/testing/test_record_custom_fields and they show up here: /polarion/#/project/Polarion/testrun?id=My%20Test%20Run1&tab=records&result=passed Let me know if that helps
leelavg commented 3 years ago
brian12559 commented 3 years ago

we also set and get custom fields on Test Runs, which are not work items.

leelavg commented 3 years ago

That's great, probably I can refer that. Thanks.

simzacks commented 3 years ago

The question would be if the wsdl supports them or not.

On Wed, Nov 3, 2021, 14:52 Leela Gangavarapu @.***> wrote:

That's great, probably I can refer that. Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RedHatQE/pylero/issues/41#issuecomment-959002280, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADF6GME5IUSGRJ35RRHDDJ3UKEWAJANCNFSM5HHDZRAA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

leelavg commented 3 years ago
simzacks commented 3 years ago

In the rest of Polarion custom fields are gotten and set through special function calls. If there is no specific function for test record custom fields, I would suspect that they could not be updated through the wsdl

brian12559 commented 3 years ago

According to Siemens this can be done... here's some info from Siemens: There are methods in our API - you can add a property to a test record, get it, and delete it:

ITestRecord.getProperty() ITestRecord.setProperty() ITestRecord.removeProperty()

Here's more information about the ITestRecord method: https://almdemo.polarion.com/polarion/sdk/doc/javadoc/com/polarion/alm/tracker/model/ITestRecord.html.

leelavg commented 3 years ago

Afaik, it isn't always given that WSDL has one-to-one mapping to internal Java implementations.

We generally query WSDL api to fill python dicts (_cls_suds_map), so not sure whether this featute can be implemented or not.

However, I'll revisit one more time before writing this off.

brian12559 commented 3 years ago

This is a must have for a few teams that use Polarion. We plan on implementing Test Failure Analysis using Polarion Test results and we will need the ability to edit these fields. Please register with Siemens Customer Support and begin a dialog with them around this if you feel that we can not do this on our own. Siemens knows that adding a custom field without providing us API access to it is not very helpful. https://support.sw.siemens.com/en-US thanks, Brian

leelavg commented 3 years ago

Being as clear as possible:

  1. Initially we were storing TestRun custom_fields xml file by directly reaching out to polarion backend repo/svnwebclient

  2. Upon request we (@waynesun09) implemented https://github.com/RedHatQE/pylero/pull/30 to use testmanagement.getDefinedTestRunCustomFieldTypes WSDL service for storing TestRun fields

  3. Current request is ability to perform get/set ops on custom fields in TestRecord, for that functionality we need to first get and store the list of custom fields in TestRecord

  4. Here's the problem, there's no WSDL service for getting those custom fields something like testmanagement.getDefinedTestRecordCustomFieldTypes

  5. Woraround would be directly accessing the backend repo/svnwebclient for caching the custom fields in TestRecord, for ex: downloading the file from svnwebclient

  6. However I don't suggest going this route for 2 reasons, one, it's not possible in polarion.engineering as backend is currently locked down and two, extra parsing of xml file is required

  7. So, unless we reach out to Siemens to provide a WSDL service for getting custom fields defined in Test Record and they implement it, IMHO we can't implement this feature request and pls excuse for the same

pinging @simzacks, @waynesun09 to weigh in their thoughts and correct me if my explanation isn't correct.

brian12559 commented 2 years ago

Hi, Any updates on this? @simzacks any suggestions on this? Siemens is telling us there is a way to get and set via the WSDL. if this is not the case we need to open a channel with them to show them we can't do it, so we can get a fix. thanks, Brian

simzacks commented 2 years ago

@brian12559 - the challenge is knowing what the names of the custom fields are so that they can be used natively in pylero. The other objects that have custom fields have a wsdl function that returns the list of field names.

brian12559 commented 2 years ago

@simzacks , OK, I think i understand. So, while not ideal can we we hardcode this until we get a function that can return the list of names. For the Test Failure Analysis part of this the custom fields we are going to add will be at the global level and will be able to changed at the Project level. In this case we will know exactly the IDs of the 3-4 custom fields we need for this. Will this allow us to hack around it?

simzacks commented 2 years ago

It could be done, the challenge is that the repo is now open-source, so we can't add anything specifically red hat to it.

Another option that we used for test runs before they added a function, was we downloaded the xml file from the repo and parsed it.

On Tue, Dec 14, 2021, 18:06 brian12559 @.***> wrote:

@simzacks https://github.com/simzacks , OK, I think i understand. So, while not ideal can we we hardcode this until we get a function that can return the list of names. For the Test Failure Analysis part of this the custom fields we are going to add will be at the global level and will be able to changed at the Project level. In this case we will know exactly the IDs of the 3-4 custom fields we need for this. Will this allow us to hack around it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RedHatQE/pylero/issues/41#issuecomment-993694258, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADF6GMHIXT77HE4UUNB23NTUQ5TPFANCNFSM5HHDZRAA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

waynesun09 commented 2 years ago

@brian12559 @leelavg Please don't post internal urls and sensitive data like credentials here on the open project, I have removed the credential in one comment. While the urls other than almdemo are still an issue here.

I don't think I have more knowledge than @leelavg on how this could be done as detailed in https://github.com/RedHatQE/pylero/issues/41#issuecomment-973790408

as I checked user could not download the xml from the prod polarion instance, @simzacks so it means download and parse it's not gonna work unless special user credentials or privilege been set up somehow which still will not work for general users.

So someone need request Siemens for providing WSDL with TestRecord like: getDefinedTestRecordCustomFieldTypes

leelavg commented 2 years ago

are still an issue here.

  • Ack, not going to post internal links again.
brian12559 commented 2 years ago

ACK...fixed mine...my bad