|
6 | 6 | from ocp_resources.inference_service import InferenceService |
7 | 7 | from ocp_resources.namespace import Namespace |
8 | 8 | from ocp_resources.pod import Pod |
| 9 | +from ocp_resources.resource import ResourceEditor |
9 | 10 | from ocp_resources.serving_runtime import ServingRuntime |
10 | 11 |
|
11 | | -from tests.model_serving.model_server.kserve.inference_service_configuration.constants import ( |
| 12 | +from tests.model_serving.model_server.kserve.inference_service_lifecycle.constants import ( |
12 | 13 | ISVC_ENV_VARS, |
13 | 14 | ORIGINAL_PULL_SECRET, |
14 | 15 | UPDATED_PULL_SECRET, |
15 | 16 | ) |
16 | | -from tests.model_serving.model_server.kserve.inference_service_configuration.utils import ( |
| 17 | +from tests.model_serving.model_server.kserve.inference_service_lifecycle.utils import ( |
17 | 18 | update_inference_service, |
18 | 19 | ) |
19 | | -from utilities.constants import KServeDeploymentType |
| 20 | +from utilities.constants import Annotations, KServeDeploymentType |
20 | 21 | from utilities.inference_utils import create_isvc |
21 | 22 | from utilities.infra import get_pods_by_isvc_label |
22 | 23 |
|
@@ -127,3 +128,20 @@ def updated_isvc_remove_pull_secret( |
127 | 128 | }, |
128 | 129 | ): |
129 | 130 | yield model_car_raw_inference_service_with_pull_secret |
| 131 | + |
| 132 | + |
| 133 | +@pytest.fixture(scope="function") |
| 134 | +def patched_raw_inference_service_stop_annotation( |
| 135 | + request: pytest.FixtureRequest, |
| 136 | + ovms_raw_inference_service: InferenceService, |
| 137 | +) -> Generator[InferenceService, Any, Any]: |
| 138 | + with ResourceEditor( |
| 139 | + patches={ |
| 140 | + ovms_raw_inference_service: { |
| 141 | + "metadata": { |
| 142 | + "annotations": {Annotations.KserveIo.FORCE_STOP_RUNTIME: request.param.get("stop", "false")} |
| 143 | + }, |
| 144 | + } |
| 145 | + } |
| 146 | + ): |
| 147 | + yield ovms_raw_inference_service |
0 commit comments