Skip to content

Commit d640ba3

Browse files
fegemwaykole
authored andcommitted
test: reorganize test structure in preparation of top folder renaming (opendatahub-io#976)
* test: reorganize test structure in preparation of top folder renaming Restructure model_registry tests into a clearer hierarchy: - Split into model_registry/ and model_catalog/ top-level domains - Group model_catalog tests by function: catalog_config, metadata, upgrade
1 parent 2f3c90d commit d640ba3

51 files changed

Lines changed: 1224 additions & 1170 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
File renamed without changes.
Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
import shlex
2-
from simple_logger.logger import get_logger
3-
42
import pytest
53
from ocp_utilities.monitoring import Prometheus
64
from pyhelper_utils.shell import run_command
75

8-
LOGGER = get_logger(name=__name__)
9-
106

117
def get_prometheus_k8s_token(duration: str = "1800s") -> str:
128
token_command = f"oc create token prometheus-k8s -n openshift-monitoring --duration={duration}"
@@ -21,16 +17,3 @@ def prometheus_for_monitoring() -> Prometheus:
2117
verify_ssl=False,
2218
bearer_token=get_prometheus_k8s_token(duration="86400s"),
2319
)
24-
25-
26-
@pytest.mark.order("last")
27-
def test_mr_operator_not_oomkilled(prometheus_for_monitoring: Prometheus):
28-
result = prometheus_for_monitoring.query_sampler(
29-
query='kube_pod_container_status_last_terminated_reason{reason="OOMKilled"}'
30-
)
31-
if result:
32-
for entry in result:
33-
LOGGER.info(entry)
34-
pod_name = entry["metric"]["pod"]
35-
if pod_name.startswith("model-registry-operator-controller-manager"):
36-
pytest.fail(f"Pod {pod_name} was oomkilled: {entry}")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from simple_logger.logger import get_logger
2+
3+
import pytest
4+
from ocp_utilities.monitoring import Prometheus
5+
6+
LOGGER = get_logger(name=__name__)
7+
8+
9+
@pytest.mark.order("last")
10+
def test_mr_operator_not_oomkilled(prometheus_for_monitoring: Prometheus):
11+
result = prometheus_for_monitoring.query_sampler(
12+
query='kube_pod_container_status_last_terminated_reason{reason="OOMKilled"}'
13+
)
14+
if result:
15+
for entry in result:
16+
LOGGER.info(entry)
17+
pod_name = entry["metric"]["pod"]
18+
if pod_name.startswith("model-registry-operator-controller-manager"):
19+
pytest.fail(f"Pod {pod_name} was oomkilled: {entry}")

0 commit comments

Comments
 (0)