Skip to content

Commit

Permalink
[6.13.z] Markers as test property in reports (#13591)
Browse files Browse the repository at this point in the history
Markers as test property in reports (#13043)

(cherry picked from commit 8d9af78)

Co-authored-by: Jitendra Yejare <[email protected]>
  • Loading branch information
Satellite-QE and jyejare authored Jan 4, 2024
1 parent ffdf0a9 commit 362a0f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion pytest_plugins/metadata_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,18 @@ def pytest_collection_modifyitems(items, config):

# add markers as user_properties so they are recorded in XML properties of the report
# pytest-ibutsu will include user_properties dict in testresult metadata
markers_prop_data = []
exclude_markers = ['parametrize', 'skipif', 'usefixtures', 'skip_if_not_set']
for marker in item.iter_markers():
item.user_properties.append((marker.name, next(iter(marker.args), None)))
prop = marker.name
if prop in exclude_markers:
continue
if marker_val := next(iter(marker.args), None):
prop = '='.join([prop, str(marker_val)])
markers_prop_data.append(prop)
item.user_properties.append(("markers", ", ".join(markers_prop_data)))

# Version specific user properties
item.user_properties.append(("BaseOS", rhel_version))
item.user_properties.append(("SatelliteVersion", sat_version))
item.user_properties.append(("SnapVersion", snap_version))
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/virtwho/ui/test_nutanix_sca.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:CaseComponent: Virt-whoConfigurePlugin
:Team: Phoenix
:Team: Phoenix-subscriptions
:TestType: Functional
Expand Down

0 comments on commit 362a0f4

Please sign in to comment.