Skip to content

Commit 8bde25e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into cp_maria
2 parents 0ef6355 + 705fd1f commit 8bde25e

File tree

19 files changed

+469
-640
lines changed

19 files changed

+469
-640
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ dependencies = [
5050
"pyyaml",
5151
"tenacity",
5252
"types-requests>=2.32.0.20241016",
53-
"schemathesis>=4.0.0a8",
5453
"requests",
5554
"pytest-asyncio",
5655
"syrupy",

schemathesis.toml

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/model_explainability/lm_eval/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
LOGGER = get_logger(name=__name__)
1010

1111

12-
def get_lmevaljob_pod(client: DynamicClient, lmevaljob: LMEvalJob, timeout: int = Timeout.TIMEOUT_2MIN) -> Pod:
12+
def get_lmevaljob_pod(client: DynamicClient, lmevaljob: LMEvalJob, timeout: int = Timeout.TIMEOUT_10MIN) -> Pod:
1313
"""
1414
Gets the pod corresponding to a given LMEvalJob and waits for it to be ready.
1515

tests/model_explainability/trustyai_service/service/test_trustyai_service.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ def test_validate_trustyai_service_image(
197197
indirect=True,
198198
)
199199
@pytest.mark.usefixtures("minio_pod")
200-
@pytest.mark.smoke
201200
def test_trustyai_service_db_migration(
202201
admin_client,
203202
current_client_token,

tests/model_explainability/trustyai_service/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def wait_for_mariadb_operator_deployments(mariadb_operator: MariadbOperator) ->
3838
deployment.wait_for_replicas()
3939

4040

41-
def wait_for_mariadb_pods(client: DynamicClient, mariadb: MariaDB, timeout: int = Timeout.TIMEOUT_5MIN) -> None:
41+
def wait_for_mariadb_pods(client: DynamicClient, mariadb: MariaDB, timeout: int = Timeout.TIMEOUT_15MIN) -> None:
4242
def _get_mariadb_pods() -> list[Pod]:
4343
_pods = [
4444
_pod

tests/model_registry/conftest.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import os
21
import pytest
32
from pytest import Config
4-
import schemathesis
53
from typing import Generator, Any
64

75
from ocp_resources.infrastructure import Infrastructure
@@ -14,10 +12,6 @@
1412
from ocp_resources.deployment import Deployment
1513

1614
from ocp_resources.model_registry_modelregistry_opendatahub_io import ModelRegistry
17-
from schemathesis.specs.openapi.schemas import BaseOpenAPISchema
18-
from schemathesis.generation.stateful.state_machine import APIStateMachine
19-
from schemathesis.core.transport import Response
20-
from schemathesis.generation.case import Case
2115
from ocp_resources.resource import ResourceEditor
2216

2317
from pytest import FixtureRequest
@@ -279,43 +273,6 @@ def model_registry_instance_rest_endpoint(admin_client: DynamicClient, model_reg
279273
)
280274

281275

282-
@pytest.fixture(scope="class")
283-
def generated_schema(pytestconfig: Config, model_registry_instance_rest_endpoint: str) -> BaseOpenAPISchema:
284-
os.environ["API_HOST"] = model_registry_instance_rest_endpoint
285-
config = schemathesis.config.SchemathesisConfig.from_path(f"{pytestconfig.rootpath}/schemathesis.toml")
286-
schema = schemathesis.openapi.from_url(
287-
url="https://raw.githubusercontent.com/kubeflow/model-registry/main/api/openapi/model-registry.yaml",
288-
config=config,
289-
)
290-
return schema
291-
292-
293-
@pytest.fixture()
294-
def state_machine(generated_schema: BaseOpenAPISchema, current_client_token: str) -> APIStateMachine:
295-
BaseAPIWorkflow = generated_schema.as_state_machine()
296-
297-
class APIWorkflow(BaseAPIWorkflow): # type: ignore
298-
headers: dict[str, str]
299-
300-
def setup(self) -> None:
301-
self.headers = {"Authorization": f"Bearer {current_client_token}", "Content-Type": "application/json"}
302-
303-
def before_call(self, case: Case) -> None:
304-
LOGGER.info(f"Checking: {case.method} {case.path}")
305-
306-
# these kwargs are passed to requests.request()
307-
def get_call_kwargs(self, case: Case) -> dict[str, Any]:
308-
return {"verify": False, "headers": self.headers}
309-
310-
def after_call(self, response: Response, case: Case) -> None:
311-
LOGGER.info(
312-
f"Method tested: {case.method}, API: {case.path}, response code:{response.status_code},"
313-
f" Full Response:{response.text}"
314-
)
315-
316-
return APIWorkflow
317-
318-
319276
@pytest.fixture(scope="class")
320277
def updated_dsc_component_state_scope_class(
321278
pytestconfig: Config,

tests/model_registry/test_rest_api.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

tests/model_registry/test_rest_api_stateful.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

tests/model_serving/model_server/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ def ovms_kserve_inference_service(
359359
if (scale_target := request.param.get("scale-target")) is not None:
360360
isvc_kwargs["scale_target"] = scale_target
361361

362+
isvc_kwargs["stop_resume"] = request.param.get("stop", False)
363+
362364
with create_isvc(**isvc_kwargs) as isvc:
363365
yield isvc
364366

@@ -382,6 +384,7 @@ def ovms_raw_inference_service(
382384
model_format=ModelAndFormat.OPENVINO_IR,
383385
deployment_mode=KServeDeploymentType.RAW_DEPLOYMENT,
384386
model_version=request.param["model-version"],
387+
stop_resume=request.param.get("stop", False),
385388
) as isvc:
386389
yield isvc
387390

tests/model_serving/model_server/serverless/test_scale_to_zero.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_serverless_before_scale_to_zero(self, ovms_kserve_inference_service):
6161
@pytest.mark.dependency(name=NO_PODS_AFTER_SCALE_TEST_NAME)
6262
def test_no_serverless_pods_after_scale_to_zero(self, unprivileged_client, inference_service_patched_replicas):
6363
"""Verify pods are scaled to zero"""
64-
verify_no_inference_pods(client=unprivileged_client, isvc=inference_service_patched_replicas)
64+
assert verify_no_inference_pods(client=unprivileged_client, isvc=inference_service_patched_replicas)
6565

6666
@pytest.mark.dependency(
6767
name=INFERENCE_AFTER_SCALE_TEST_NAME,
@@ -84,7 +84,7 @@ def test_serverless_inference_after_scale_to_zero(self, inference_service_patche
8484
@pytest.mark.order(4)
8585
def test_no_serverless_pods_when_no_traffic(self, unprivileged_client, inference_service_patched_replicas):
8686
"""Verify pods are scaled to zero when no traffic is sent"""
87-
verify_no_inference_pods(client=unprivileged_client, isvc=inference_service_patched_replicas)
87+
assert verify_no_inference_pods(client=unprivileged_client, isvc=inference_service_patched_replicas)
8888

8989
@pytest.mark.parametrize(
9090
"inference_service_patched_replicas",

0 commit comments

Comments
 (0)