From bbba3fc402377795c0f4899f1cf797c3d9d7629c Mon Sep 17 00:00:00 2001 From: dosas Date: Fri, 15 Mar 2024 08:35:48 +0100 Subject: [PATCH] Add posibility to filter tests that require manifester (#14270) (cherry picked from commit 0397a0d1db879dccd84a099e7ee0765df53dda61) --- pytest_plugins/markers.py | 1 + tests/foreman/conftest.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pytest_plugins/markers.py b/pytest_plugins/markers.py index 90000233699..1df9f8e9013 100644 --- a/pytest_plugins/markers.py +++ b/pytest_plugins/markers.py @@ -23,6 +23,7 @@ def pytest_configure(config): "no_containers: Disable container hosts from being used in favor of VMs", "include_capsule: For satellite-maintain tests to run on Satellite and Capsule both", "capsule_only: For satellite-maintain tests to run only on Capsules", + "manifester: Tests that require manifester", ] markers.extend(module_markers()) for marker in markers: diff --git a/tests/foreman/conftest.py b/tests/foreman/conftest.py index e867e118be3..339eb6016f9 100644 --- a/tests/foreman/conftest.py +++ b/tests/foreman/conftest.py @@ -30,6 +30,8 @@ def pytest_collection_modifyitems(session, items, config): deselected_items = [] for item in items: + if any("manifest" in f for f in getattr(item, "fixturenames", ())): + item.add_marker("manifester") # 1. Deselect tests marked with @pytest.mark.deselect # WONTFIX BZs makes test to be dynamically marked as deselect. deselect = item.get_closest_marker('deselect')