Skip to content

Commit d83f060

Browse files
authored
Merge branch 'main' into enhance-vector-store-dataset
2 parents 7ccf367 + ba6b7f3 commit d83f060

File tree

7 files changed

+34
-33
lines changed

7 files changed

+34
-33
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
ci:
2+
autofix_prs: true
3+
14
minimum_pre_commit_version: 3.3.0
25
default_install_hook_types: [pre-commit, commit-msg]
36

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ utilities/ # Shared utility functions
8888
- Moving fixtures to shared locations
8989
- Adding new markers to `pytest.ini`
9090
- Modifying session-scoped fixtures
91+
- Adding new binaries or system-level dependencies (must also update `Dockerfile` and verify with `make build`)
9192

9293
### 🚫 Never
9394

conftest.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@
4242
LOGGER = logging.getLogger(name=__name__)
4343
BASIC_LOGGER = logging.getLogger(name="basic")
4444

45+
# Add support to mark tests that does not have specific marking already, with tier2 marker
46+
EXCLUDE_MARKERS_FROM_DEFAULT_TIER2: set[str] = {"smoke", "tier1", "tier2", "tier3", "pre_upgrade", "post_upgrade"}
47+
# To include a component for default marking please add the component path to this list
48+
DEFAULT_TIER2_MARKER_TEST_PATHS: tuple[str, ...] = (
49+
"tests/model_registry",
50+
"tests/model_explainability",
51+
"tests/model_serving/maas_billing",
52+
)
53+
4554

4655
def pytest_addoption(parser: Parser) -> None:
4756
aws_group = parser.getgroup(name="AWS")
@@ -286,6 +295,19 @@ def _add_upgrade_test(_item: Item, _upgrade_deployment_modes: list[str]) -> bool
286295
items[:] = non_upgrade_tests
287296
config.hook.pytest_deselected(items=upgrade_tests)
288297

298+
_add_default_tier2_marker(items=items)
299+
300+
301+
def _add_default_tier2_marker(items: list[Item]) -> None:
302+
"""Add tier2 marker to tests that lack any tier/smoke/upgrade marker, for specific components."""
303+
for item in items:
304+
if not any(item.nodeid.startswith(path) for path in DEFAULT_TIER2_MARKER_TEST_PATHS):
305+
continue
306+
307+
item_markers = {mark.name for mark in item.iter_markers()}
308+
if not item_markers & EXCLUDE_MARKERS_FROM_DEFAULT_TIER2:
309+
item.add_marker(marker=pytest.mark.tier2)
310+
289311

290312
def pytest_sessionstart(session: Session) -> None:
291313
log_file = session.config.getoption(name="log_file") or "pytest-tests.log"

tests/fixtures/vector_io.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -476,21 +476,6 @@ def get_pgvector_deployment_template() -> dict[str, Any]:
476476
},
477477
{"name": "PGDATA", "value": "/var/lib/postgresql/data/pgdata"},
478478
],
479-
"lifecycle": {
480-
"postStart": {
481-
"exec": {
482-
"command": [
483-
"/bin/sh",
484-
"-c",
485-
(
486-
"sleep 5\n"
487-
f"PGPASSWORD={PGVECTOR_PASSWORD} psql -h localhost -U {PGVECTOR_USER} "
488-
'-d pgvector -c "CREATE EXTENSION IF NOT EXISTS vector;" || true'
489-
),
490-
]
491-
}
492-
}
493-
},
494479
"volumeMounts": [{"name": "pgdata", "mountPath": "/var/lib/postgresql/data"}],
495480
}
496481
],

tests/model_registry/mcp_servers/config/test_invalid_yaml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
[
2525
pytest.param(
2626
MCP_SERVERS_YAML_MALFORMED,
27-
f"Error reading MCP catalog from {MCP_SERVERS_YAML_INVALID_CATALOG_PATH}: error parsing YAML",
27+
f"{MCP_SERVERS_YAML_INVALID_CATALOG_PATH}: error parsing YAML",
2828
id="malformed_yaml",
2929
),
3030
pytest.param(

tests/model_registry/mcp_servers/constants.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
MCP_CATALOG_SOURCE_ID: str = "test_mcp_servers"
44
MCP_CATALOG_SOURCE_NAME: str = "Test MCP Servers"
55
MCP_CATALOG_API_PATH: str = "/api/mcp_catalog/v1alpha1/"
6-
MCP_SERVERS_YAML_CATALOG_PATH: str = "/data/user-sources/mcp-servers.yaml"
6+
MCP_SERVERS_YAML_CATALOG_PATH: str = "mcp-servers.yaml"
77

88
MCP_SERVERS_YAML: str = """\
99
mcp_servers:
@@ -86,7 +86,7 @@
8686

8787
MCP_CATALOG_SOURCE2_ID: str = "test_mcp_servers_2"
8888
MCP_CATALOG_SOURCE2_NAME: str = "Test MCP Servers 2"
89-
MCP_SERVERS_YAML2_CATALOG_PATH: str = "/data/user-sources/mcp-servers-2.yaml"
89+
MCP_SERVERS_YAML2_CATALOG_PATH: str = "mcp-servers-2.yaml"
9090

9191
MCP_SERVERS_YAML2: str = """\
9292
mcp_servers:
@@ -136,7 +136,7 @@
136136

137137
MCP_CATALOG_INVALID_SOURCE_ID: str = "test_mcp_servers_invalid"
138138
MCP_CATALOG_INVALID_SOURCE_NAME: str = "Test MCP Servers Invalid"
139-
MCP_SERVERS_YAML_INVALID_CATALOG_PATH: str = "/data/user-sources/mcp-servers-invalid.yaml"
139+
MCP_SERVERS_YAML_INVALID_CATALOG_PATH: str = "mcp-servers-invalid.yaml"
140140

141141
MCP_SERVERS_YAML_MALFORMED: str = """\
142142
mcp_servers:
@@ -188,15 +188,15 @@
188188
# Source 3: unlabeled source (no labels) for sourceLabel=null testing
189189
MCP_CATALOG_SOURCE3_ID: str = "test_mcp_servers_unlabeled"
190190
MCP_CATALOG_SOURCE3_NAME: str = "Test MCP Servers Unlabeled"
191-
MCP_SERVERS_YAML3_CATALOG_PATH: str = "/data/user-sources/mcp-servers-3.yaml"
191+
MCP_SERVERS_YAML3_CATALOG_PATH: str = "mcp-servers-3.yaml"
192192

193193
MCP_SERVERS_YAML3: str = """\
194194
mcp_servers:
195195
- name: database-connector
196196
description: "Database connection MCP server"
197197
provider: "Data Tools"
198198
version: "1.0.0"
199-
license: "MIT"
199+
license: "PostgreSQL"
200200
tags:
201201
- database
202202
- sql

tests/model_registry/model_registry/rest_api/test_model_registry_rest_api.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,18 @@
4242
{},
4343
{},
4444
MODEL_REGISTER_DATA,
45-
marks=(pytest.mark.tier1),
45+
marks=pytest.mark.tier1,
4646
),
4747
pytest.param(
4848
{"db_name": "postgres"},
4949
{"db_name": "postgres"},
5050
MODEL_REGISTER_DATA,
51-
marks=(pytest.mark.tier2),
51+
marks=pytest.mark.smoke,
5252
),
5353
pytest.param(
5454
{"db_name": "default"},
5555
{"db_name": "default"},
5656
MODEL_REGISTER_DATA,
57-
marks=(pytest.mark.tier2),
5857
),
5958
pytest.param(
6059
{"db_name": "mariadb"},
@@ -84,7 +83,6 @@ class TestModelRegistryCreationRest:
8483
pytest.param(
8584
MODEL_REGISTER,
8685
"register_model",
87-
marks=pytest.mark.smoke,
8886
id="test_validate_registered_model",
8987
),
9088
pytest.param(
@@ -111,7 +109,6 @@ def test_validate_model_registry_resource(
111109
resource_name=data_key,
112110
)
113111

114-
@pytest.mark.tier2
115112
@pytest.mark.parametrize(
116113
"kind, resource_name",
117114
[
@@ -160,7 +157,6 @@ def test_default_postgres_db_resource_exists(
160157
for field in ["controller", "blockOwnerDeletion"]:
161158
assert owner_reference[0][field] is True
162159

163-
@pytest.mark.tier2
164160
def test_default_postgres_db_pod_log(
165161
self: Self,
166162
skip_if_not_default_db: None,
@@ -180,7 +176,6 @@ def test_default_postgres_db_pod_log(
180176
postgres_pod_log = pods[0].log(container="postgres")
181177
assert CONNECTION_STRING in postgres_pod_log
182178

183-
@pytest.mark.tier2
184179
def test_model_registry_validate_api_version(
185180
self: Self,
186181
admin_client: DynamicClient,
@@ -196,7 +191,6 @@ def test_model_registry_validate_api_version(
196191
expected_version = f"{ModelRegistry.ApiGroup.MODELREGISTRY_OPENDATAHUB_IO}/{ModelRegistry.ApiVersion.V1BETA1}"
197192
assert api_version == expected_version
198193

199-
@pytest.mark.tier2
200194
def test_model_registry_validate_kuberbacproxy_enabled(
201195
self: Self,
202196
model_registry_instance: list[ModelRegistry],
@@ -239,7 +233,6 @@ def test_model_registry_validate_kuberbacproxy_enabled(
239233
],
240234
indirect=["updated_model_registry_resource"],
241235
)
242-
@pytest.mark.tier2
243236
def test_create_update_model_artifact(
244237
self,
245238
updated_model_registry_resource: dict[str, Any],
@@ -284,7 +277,6 @@ def test_create_update_model_artifact(
284277
],
285278
indirect=["updated_model_registry_resource"],
286279
)
287-
@pytest.mark.tier2
288280
def test_updated_model_version(
289281
self,
290282
updated_model_registry_resource: dict[str, Any],
@@ -330,7 +322,6 @@ def test_updated_model_version(
330322
],
331323
indirect=["updated_model_registry_resource"],
332324
)
333-
@pytest.mark.tier2
334325
def test_updated_registered_model(
335326
self,
336327
updated_model_registry_resource: dict[str, Any],
@@ -375,7 +366,6 @@ class TestModelRegistryDeployment:
375366
Tests the complete deployment workflow from registered model to InferenceService.
376367
"""
377368

378-
@pytest.mark.tier2
379369
def test_registered_model_deployment(
380370
self,
381371
admin_client: DynamicClient,

0 commit comments

Comments
 (0)