forked from opendatahub-io/opendatahub-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_route_reconciliation.py
More file actions
53 lines (46 loc) · 2.26 KB
/
test_route_reconciliation.py
File metadata and controls
53 lines (46 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import pytest
from tests.model_serving.model_server.kserve.ingress.utils import assert_ingress_status_changed
from tests.model_serving.model_server.utils import verify_inference_response
from utilities.constants import ModelFormat, ModelVersion, Protocols, RunTimeConfigs
from utilities.inference_utils import Inference
from utilities.manifests.onnx import ONNX_INFERENCE_CONFIG
pytestmark = [pytest.mark.rawdeployment, pytest.mark.usefixtures("valid_aws_config")]
@pytest.mark.parametrize(
"unprivileged_model_namespace, ovms_kserve_serving_runtime, ovms_raw_inference_service",
[
pytest.param(
{"name": "kserve-raw-route-reconciliation"},
RunTimeConfigs.ONNX_OPSET13_RUNTIME_CONFIG,
{"name": ModelFormat.ONNX, "model-version": ModelVersion.OPSET13, "model-dir": "test-dir"},
)
],
indirect=True,
)
class TestONNXRawRouteReconciliation:
"""Test suite for Validating reconciliation"""
@pytest.mark.tier1
def test_raw_onnx_rout_reconciliation(self, ovms_raw_inference_service):
"""
Verify that the KServe Raw ONNX model can be queried using REST
and ensure that the model rout reconciliation works correctly .
"""
# Initial inference validation
verify_inference_response(
inference_service=ovms_raw_inference_service,
inference_config=ONNX_INFERENCE_CONFIG,
inference_type=Inference.INFER,
protocol=Protocols.HTTPS,
use_default_query=True,
)
def test_route_value_before_and_after_deletion(self, unprivileged_client, ovms_raw_inference_service):
"""Verify that the ingress status changes after the route is deleted and recreated."""
assert_ingress_status_changed(client=unprivileged_client, inference_service=ovms_raw_inference_service)
def test_model_works_after_route_is_recreated(self, ovms_raw_inference_service):
"""Verify that the model is still queryable via REST after the route is recreated."""
verify_inference_response(
inference_service=ovms_raw_inference_service,
inference_config=ONNX_INFERENCE_CONFIG,
inference_type=Inference.INFER,
protocol=Protocols.HTTPS,
use_default_query=True,
)