Skip to content
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

test_run.py: _custom_fields seems not initialized correctly #157

Open
sleviim opened this issue Sep 28, 2023 · 3 comments
Open

test_run.py: _custom_fields seems not initialized correctly #157

sleviim opened this issue Sep 28, 2023 · 3 comments

Comments

@sleviim
Copy link

sleviim commented Sep 28, 2023

When trying to use the get_custom_field() function for getting a custom field value of a test run, the returned item is None.
In test_run.py#get_custom_field there's the following assignment: cf = self._custom_fields
Using print(cf) returns an empty list and it seems it wasn't initialized correctly.

Some observations:

  • The object seems to be a legit test run (printing tr.test_run_id shows its id number)
  • The value seems to be a legit custom field value (I used [print(f.__dict__) for f in tr.get_defined_custom_field_types(project_id="PROJ")] for listing all custom values and used one of them)
  • I applied the fix from patch fix-issue-150 #151
@leelavg
Copy link
Collaborator

leelavg commented Sep 29, 2023

I applied the fix from patch #151

  • didn't get this, does this patch has to do anything with the current issue? I just merged that patch.

@leelavg
Copy link
Collaborator

leelavg commented Sep 29, 2023

Notes for me: Somehow the custom fields aren't getting populated correctly when they were being set in base polarion from CustomFieldType or EnumCustomFieldType.

I did spend some good amount of time, didn't come to any conclusion, will recheck.

@sleviim
Copy link
Author

sleviim commented Oct 23, 2023

Hi,
I tried to do some testing and those are the results I ran into so far:

  • I had to wrap each test run I got in tc.which_test_runs() with 'TestRun'
    so the code looks like: tr = TestRun(tr.test_run_id, project_id="XX") [print(f.__dict__) for f in tr._custom_fields]
    Here's a snippet of the output (instead of an empty list:
    {'_cls_suds_map': {'key': 'key', 'value': {'field_name': 'value', 'cls': <class 'pylero.enum_option_id.EnumOptionId'>}}, '_suds_object': (Custom){ key = "build" value = "glibc-XXX-aarch64" }}
    It seems that reaching the 'build' info isn't just using key & value, but is more complex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants