Skip to content

Commit c6f9c9e

Browse files
committed
test: add test cases for OpenVINO runtime
Signed-off-by: Snomaan6846 <syedali@redhat.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
1 parent dcff182 commit c6f9c9e

16 files changed

+5676
-1
lines changed

tests/conftest.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,3 +697,28 @@ def mariadb_operator_cr(
697697
)
698698
wait_for_mariadb_operator_deployments(mariadb_operator=mariadb_operator_cr)
699699
yield mariadb_operator_cr
700+
701+
702+
@pytest.fixture(scope="session")
703+
def gpu_count_on_cluster(nodes: list[Any]) -> int:
704+
"""Return total GPU count across all nodes in the cluster.
705+
706+
Counts full-GPU extended resources only:
707+
- nvidia.com/gpu
708+
- amd.com/gpu
709+
- gpu.intel.com/* (e.g., i915, xe)
710+
Note: MIG slice resources (nvidia.com/mig-*) are intentionally ignored.
711+
"""
712+
total_gpus = 0
713+
allowed_exact = {"nvidia.com/gpu", "amd.com/gpu", "intel.com/gpu"}
714+
allowed_prefixes = ("gpu.intel.com/",)
715+
for node in nodes:
716+
allocatable = getattr(node.instance.status, "allocatable", {}) or {}
717+
for key, val in allocatable.items():
718+
if key in allowed_exact or any(key.startswith(p) for p in allowed_prefixes):
719+
try:
720+
total_gpus += int(val)
721+
except (ValueError, TypeError):
722+
LOGGER.debug(f"Skipping non-integer allocatable for {key} on {node.name}: {val!r}")
723+
continue
724+
return total_gpus

tests/model_serving/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def kserve_s3_secret(
6666
"""
6767
with kserve_s3_endpoint_secret(
6868
admin_client=admin_client,
69-
name="mlserver-models-bucket-secret",
69+
name="models-bucket-secret",
7070
namespace=model_namespace.name,
7171
aws_access_key=aws_access_key_id,
7272
aws_secret_access_key=aws_secret_access_key,

tests/model_serving/model_runtime/openvino/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"model_name": "onnx",
3+
"model_version": "1",
4+
"outputs": [
5+
{
6+
"data": [
7+
-8.233053207397461,
8+
-7.749701976776123,
9+
-3.4236819744110107,
10+
12.363025665283203,
11+
-12.07910442352295,
12+
17.266592025756836,
13+
-10.570975303649902,
14+
0.7130780220031738,
15+
3.3217153549194336,
16+
1.3621225357055664
17+
],
18+
"datatype": "FP32",
19+
"name": "Plus214_Output_0",
20+
"shape": [
21+
1,
22+
10
23+
]
24+
}
25+
]
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"model_name": "onnx",
3+
"model_version": "1",
4+
"outputs": [
5+
{
6+
"data": [
7+
-8.233053207397461,
8+
-7.749701976776123,
9+
-3.4236819744110107,
10+
12.363025665283203,
11+
-12.07910442352295,
12+
17.266592025756836,
13+
-10.570975303649902,
14+
0.7130780220031738,
15+
3.3217153549194336,
16+
1.3621225357055664
17+
],
18+
"datatype": "FP32",
19+
"name": "Plus214_Output_0",
20+
"shape": [
21+
1,
22+
10
23+
]
24+
}
25+
]
26+
}

0 commit comments

Comments
 (0)