Skip to content

Commit

Permalink
Markers as test property in reports
Browse files Browse the repository at this point in the history
  • Loading branch information
jyejare committed Nov 3, 2023
1 parent c7d24e8 commit 89daccb
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 89daccb

Please sign in to comment.