Skip to content
Merged
Changes from 4 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
40 changes: 40 additions & 0 deletions tests/model_registry/cluster_health/test_mr_default.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import pytest
from utilities.infra import get_data_science_cluster
from utilities.constants import DscComponents
from kubernetes.dynamic import DynamicClient

from ocp_resources.namespace import Namespace

from simple_logger.logger import get_logger
from pytest_testconfig import config as py_config


LOGGER = get_logger(name=__name__)


class TestMrDefault:
@pytest.mark.cluster_health
def test_mr_default(self, admin_client: DynamicClient):
"""
Verify MODELREGISTRY managementState is MANAGED in DSC,
the namespace is Active, and the MR ready condition in DSC is True.
"""
dsc_resource = get_data_science_cluster(client=admin_client)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
assert (
dsc_resource.instance.spec.components[DscComponents.MODELREGISTRY].managementState
== DscComponents.ManagementState.MANAGED
)
namespace = Namespace(
name=dsc_resource.instance.spec.components[DscComponents.MODELREGISTRY].registriesNamespace,
ensure_exists=True,
)
assert namespace.instance.status.phase == Namespace.Status.ACTIVE
Comment thread
fege marked this conversation as resolved.
assert namespace.instance.metadata.name == py_config["model_registry_namespace"]

for condition in dsc_resource.instance.status.conditions:
Comment thread
fege marked this conversation as resolved.
if condition.type == DscComponents.COMPONENT_MAPPING[DscComponents.MODELREGISTRY]:
LOGGER.info(f"MR ready in DSC: {condition.status}")
assert condition.status == "True"
break
else:
pytest.fail("MR not ready in DSC")