Skip to content

Commit db3b5e2

Browse files
authored
Merge branch 'opendatahub-io:main' into main
2 parents e9f3d52 + 69800c3 commit db3b5e2

File tree

20 files changed

+470
-641
lines changed

20 files changed

+470
-641
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ repos:
3535
- id: detect-secrets
3636

3737
- repo: https://github.com/astral-sh/ruff-pre-commit
38-
rev: v0.12.1
38+
rev: v0.12.2
3939
hooks:
4040
- id: ruff
4141
- id: ruff-format

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
@@ -299,43 +293,6 @@ def model_registry_instance_rest_endpoint(
299293
return get_endpoint_from_mr_service(svc=model_registry_instance_service, protocol=Protocols.REST)
300294

301295

302-
@pytest.fixture(scope="class")
303-
def generated_schema(pytestconfig: Config, model_registry_instance_rest_endpoint: str) -> BaseOpenAPISchema:
304-
os.environ["API_HOST"] = model_registry_instance_rest_endpoint
305-
config = schemathesis.config.SchemathesisConfig.from_path(f"{pytestconfig.rootpath}/schemathesis.toml")
306-
schema = schemathesis.openapi.from_url(
307-
url="https://raw.githubusercontent.com/kubeflow/model-registry/main/api/openapi/model-registry.yaml",
308-
config=config,
309-
)
310-
return schema
311-
312-
313-
@pytest.fixture()
314-
def state_machine(generated_schema: BaseOpenAPISchema, current_client_token: str) -> APIStateMachine:
315-
BaseAPIWorkflow = generated_schema.as_state_machine()
316-
317-
class APIWorkflow(BaseAPIWorkflow): # type: ignore
318-
headers: dict[str, str]
319-
320-
def setup(self) -> None:
321-
self.headers = {"Authorization": f"Bearer {current_client_token}", "Content-Type": "application/json"}
322-
323-
def before_call(self, case: Case) -> None:
324-
LOGGER.info(f"Checking: {case.method} {case.path}")
325-
326-
# these kwargs are passed to requests.request()
327-
def get_call_kwargs(self, case: Case) -> dict[str, Any]:
328-
return {"verify": False, "headers": self.headers}
329-
330-
def after_call(self, response: Response, case: Case) -> None:
331-
LOGGER.info(
332-
f"Method tested: {case.method}, API: {case.path}, response code:{response.status_code},"
333-
f" Full Response:{response.text}"
334-
)
335-
336-
return APIWorkflow
337-
338-
339296
@pytest.fixture(scope="class")
340297
def updated_dsc_component_state_scope_class(
341298
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

0 commit comments

Comments
 (0)