Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Config,
CollectReport,
)
from _pytest.nodes import Node
from _pytest.terminal import TerminalReporter
from typing import Optional, Any
from pytest_testconfig import config as py_config
Expand Down Expand Up @@ -434,9 +435,17 @@ def calculate_must_gather_timer(test_start_time: int) -> int:
return default_duration


def get_all_node_markers(node: Node) -> list[str]:
return [mark.name for mark in list(node.iter_markers())]


def is_skip_must_gather(node: Node) -> bool:
return "skip_must_gather" in get_all_node_markers(node=node)


def pytest_exception_interact(node: Item | Collector, call: CallInfo[Any], report: TestReport | CollectReport) -> None:
LOGGER.error(report.longreprtext)
if node.config.getoption("--collect-must-gather"):
if node.config.getoption("--collect-must-gather") and not is_skip_must_gather(node=node):
test_name = f"{node.fspath}::{node.name}"
LOGGER.info(f"Must-gather collection is enabled for {test_name}.")

Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ markers =
ocp_interop: Interop testing with Openshift.
downstream_only: Tests that are specific to downstream
cluster_health: Tests that verifies that cluster is healthy to begin testing
skip_must_gather: Tests that does not require must-gather for triaging

# Model server
modelmesh: Mark tests which are model mesh tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class TestModelRegistryImages:
"""

@pytest.mark.smoke
@pytest.mark.skip_must_gather
def test_verify_model_registry_images(
self: Self,
admin_client: DynamicClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
]


@pytest.mark.skip_must_gather
class TestModelCatalogGeneral:
@pytest.mark.post_upgrade
def test_config_map_exists(self: Self, catalog_config_map: ConfigMap):
Expand Down