|
1 | 1 | import pytest |
2 | | -from typing import Self |
| 2 | +from typing import Self, Any |
3 | 3 | from simple_logger.logger import get_logger |
4 | 4 | from pytest_testconfig import config as py_config |
5 | 5 |
|
6 | 6 | from ocp_resources.pod import Pod |
7 | 7 | from ocp_resources.namespace import Namespace |
| 8 | +from tests.model_registry.utils import execute_model_registry_get_command |
8 | 9 | from utilities.constants import DscComponents |
9 | 10 | from tests.model_registry.constants import MODEL_NAME, MODEL_DICT |
10 | 11 | from model_registry import ModelRegistry as ModelRegistryClient |
@@ -86,7 +87,41 @@ def test_model_registry_operator_env( |
86 | 87 | if not namespace_env: |
87 | 88 | pytest.fail("Missing environment variable REGISTRIES_NAMESPACE") |
88 | 89 |
|
89 | | - # TODO: Edit a registered model |
90 | | - # TODO: Add additional versions for a model |
91 | | - # TODO: List all available models |
92 | | - # TODO: List all versions of a model |
| 90 | + def test_model_registry_grpc_container_removal(self, model_registry_deployment_containers: dict[str, Any]): |
| 91 | + """ |
| 92 | + RHOAIENG-26239: Test to ensure removal of grpc container from model registry deployment |
| 93 | + Steps: |
| 94 | + Create metadata database |
| 95 | + Deploys model registry using the same |
| 96 | + Check model registry deployment for grpc container. It should not be present |
| 97 | + """ |
| 98 | + |
| 99 | + for container in model_registry_deployment_containers: |
| 100 | + if "grpc" in container["name"]: |
| 101 | + pytest.fail(f"GRPC container found: {container}") |
| 102 | + |
| 103 | + @pytest.mark.parametrize( |
| 104 | + "endpoint", |
| 105 | + [ |
| 106 | + pytest.param( |
| 107 | + "oauth/healthz", |
| 108 | + ), |
| 109 | + pytest.param( |
| 110 | + "readyz/isDirty", |
| 111 | + ), |
| 112 | + ], |
| 113 | + ) |
| 114 | + def test_model_registry_endpoint_response( |
| 115 | + self, model_registry_rest_url: str, model_registry_rest_headers: dict[str, str], endpoint: str |
| 116 | + ): |
| 117 | + """ |
| 118 | + RHOAIENG-26239: Test to ensure model registry endpoints are responsive |
| 119 | + Steps: |
| 120 | + Create metadata database |
| 121 | + Deploys model registry using the same |
| 122 | + Ensure endpoint is responsive via get call |
| 123 | + """ |
| 124 | + output = execute_model_registry_get_command( |
| 125 | + url=f"{model_registry_rest_url}/{endpoint}", headers=model_registry_rest_headers, json_output=False |
| 126 | + ) |
| 127 | + assert output["raw_output"].lower() == "OK".lower() |
0 commit comments