Skip to content

Commit ec4297d

Browse files
fegedbasunag
andauthored
Reduce smoke for model_registry component (#1122)
* test: reduce smoke time execution run * fix: merge changes from remote * test: reduce model registry smoke tests * fix: Rename sanity->tier1, cascade tier1->tier2, add tier3 for negatives * fix: move tests from tier1 to tier2 * chore: tier3 marker * fix: reduce tier1 run time --------- Co-authored-by: Debarati Basu-Nag <dbasunag@redhat.com>
1 parent 41a3ab1 commit ec4297d

23 files changed

+84
-55
lines changed

pytest.ini

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ markers =
1010
parallel: marks tests that can run in parallel along with pytest-xdist
1111

1212
# CI
13-
smoke: Mark tests as smoke tests; covers core functionality of the product. Aims to ensure that the build is stable enough for further testing.
13+
smoke: Mark tests as smoke tests; very high critical priority tests. Covers core functionality of the product. Aims to ensure that the build is stable enough for further testing.
1414
sanity: Mark tests as sanity tests. Aims to verify that specific functionality is working as expected.
15-
tier1: Mark tests as tier1. Aims to cover frequently used functionality of the product and basic user flows.
16-
tier2: Mark tests as tier2. Aims to cover more advanced functionality of the product.
15+
tier1: Mark tests as tier1. High-priority tests.
16+
tier2: Mark tests as tier2. Medium/low-priority positive tests.
17+
tier3: Mark tests as tier3. Negative and destructive tests.
1718
slow: Mark tests which take more than 10 minutes as slow tests.
1819
pre_upgrade: Mark tests which should be run before upgrading the product.
1920
post_upgrade: Mark tests which should be run after upgrading the product.

tests/model_registry/image_validation/test_verify_rhoai_images.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from utilities.constants import Labels
2020

2121
LOGGER = get_logger(name=__name__)
22-
pytestmark = [pytest.mark.downstream_only, pytest.mark.skip_must_gather, pytest.mark.smoke]
22+
pytestmark = [pytest.mark.downstream_only, pytest.mark.skip_must_gather]
2323

2424

2525
class TestAIHubResourcesImages:
@@ -28,15 +28,15 @@ class TestAIHubResourcesImages:
2828
[
2929
pytest.param(
3030
{"namespace": py_config["model_registry_namespace"], "label_selector": "component=model-catalog"},
31-
marks=pytest.mark.smoke,
31+
marks=pytest.mark.tier1,
3232
id="test_model_catalog_pods_images",
3333
),
3434
pytest.param(
3535
{
3636
"namespace": py_config["applications_namespace"],
3737
"label_selector": f"{Labels.OpenDataHubIo.NAME}={MR_OPERATOR_NAME}",
3838
},
39-
marks=pytest.mark.smoke,
39+
marks=pytest.mark.tier1,
4040
id="test_model_registry_operator_pods_images",
4141
),
4242
],
@@ -54,7 +54,7 @@ def test_verify_pod_images(
5454
@pytest.mark.parametrize(
5555
"model_registry_metadata_db_resources, model_registry_instance, model_registry_instance_pods_by_label",
5656
[
57-
pytest.param({}, {}, {"label_selectors": [f"app={MR_INSTANCE_NAME}"]}),
57+
pytest.param({}, {}, {"label_selectors": [f"app={MR_INSTANCE_NAME}"]}, marks=pytest.mark.smoke),
5858
pytest.param(
5959
{"db_name": "default"},
6060
{"db_name": "default"},
@@ -64,6 +64,7 @@ def test_verify_pod_images(
6464
f"app.kubernetes.io/name={MR_POSTGRES_DEPLOYMENT_NAME_STR}",
6565
]
6666
},
67+
marks=pytest.mark.tier2,
6768
),
6869
],
6970
indirect=True,

tests/model_registry/model_catalog/catalog_config/test_default_source_inclusion_exclusion_cleanup.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,22 @@ class TestModelInclusionFiltering:
3535
[
3636
pytest.param(
3737
{"filter_type": "inclusion", "pattern": "granite", "filter_value": "*granite*"},
38-
marks=pytest.mark.smoke,
38+
marks=pytest.mark.tier2,
3939
id="test_include_granite_models_only",
4040
),
4141
pytest.param(
4242
{"filter_type": "inclusion", "pattern": "prometheus", "filter_value": "*prometheus*"},
43-
marks=pytest.mark.sanity,
43+
marks=pytest.mark.tier2,
4444
id="test_include_prometheus_models_only",
4545
),
4646
pytest.param(
4747
{"filter_type": "inclusion", "pattern": "-8b-", "filter_value": "*-8b-*"},
48-
marks=pytest.mark.sanity,
48+
marks=pytest.mark.tier2,
4949
id="test_include_eight_b_models_only",
5050
),
5151
pytest.param(
5252
{"filter_type": "inclusion", "pattern": "code", "filter_value": "*code*"},
53-
marks=pytest.mark.sanity,
53+
marks=pytest.mark.tier2,
5454
id="test_include_code_models_only",
5555
),
5656
],
@@ -83,17 +83,17 @@ class TestModelExclusionFiltering:
8383
[
8484
pytest.param(
8585
{"filter_type": "exclusion", "pattern": "granite", "filter_value": "*granite*"},
86-
marks=pytest.mark.smoke,
86+
marks=pytest.mark.tier2,
8787
id="test_exclude_granite_models",
8888
),
8989
pytest.param(
9090
{"filter_type": "exclusion", "pattern": "prometheus", "filter_value": "*prometheus*"},
91-
marks=pytest.mark.sanity,
91+
marks=pytest.mark.tier1,
9292
id="test_exclude_prometheus_models",
9393
),
9494
pytest.param(
9595
{"filter_type": "exclusion", "pattern": "lab", "filter_value": "*lab*"},
96-
marks=pytest.mark.sanity,
96+
marks=pytest.mark.tier2,
9797
id="test_exclude_lab_models",
9898
),
9999
],
@@ -132,7 +132,7 @@ class TestCombinedIncludeExcludeFiltering:
132132
"exclude_pattern": "lab",
133133
"exclude_filter_value": "*lab*",
134134
},
135-
marks=pytest.mark.smoke,
135+
marks=pytest.mark.tier2,
136136
id="include_granite_exclude_lab",
137137
),
138138
pytest.param(
@@ -143,7 +143,7 @@ class TestCombinedIncludeExcludeFiltering:
143143
"exclude_pattern": "code",
144144
"exclude_filter_value": "*code*",
145145
},
146-
marks=pytest.mark.sanity,
146+
marks=pytest.mark.tier2,
147147
id="include_eight_b_exclude_code",
148148
),
149149
],
@@ -171,7 +171,7 @@ def test_combined_include_exclude_filtering(
171171
class TestModelCleanupLifecycle:
172172
"""Test automatic model cleanup during lifecycle changes (RHOAIENG-41846)"""
173173

174-
@pytest.mark.sanity
174+
@pytest.mark.tier2
175175
def test_model_cleanup_on_exclusion_change(
176176
self,
177177
admin_client: DynamicClient,
@@ -276,7 +276,7 @@ def test_model_cleanup_on_exclusion_change(
276276
class TestSourceLifecycleCleanup:
277277
"""Test source disabling cleanup scenarios (RHOAIENG-41846)"""
278278

279-
@pytest.mark.smoke
279+
@pytest.mark.tier2
280280
def test_source_disabling_removes_models(
281281
self,
282282
admin_client: DynamicClient,
@@ -294,7 +294,7 @@ def test_source_disabling_removes_models(
294294
model_registry_namespace=model_registry_namespace,
295295
)
296296

297-
@pytest.mark.sanity
297+
@pytest.mark.tier2
298298
def test_source_disabling_logging(
299299
self,
300300
admin_client: DynamicClient,
@@ -323,7 +323,7 @@ class TestLoggingValidation:
323323
[
324324
pytest.param(
325325
{"filter_type": "exclusion", "pattern": "granite", "filter_value": "*granite*", "log_cleanup": True},
326-
marks=pytest.mark.sanity,
326+
marks=pytest.mark.tier2,
327327
id="test_exclude_granite_models_for_logging",
328328
)
329329
],

tests/model_registry/model_catalog/catalog_config/test_model_catalog_negative.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222

2323
@pytest.mark.skip_must_gather
24+
@pytest.mark.tier3
2425
class TestDefaultCatalogNegative:
2526
"""Negative tests for default catalog configuration"""
2627

tests/model_registry/model_catalog/huggingface/test_huggingface_model_deployment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class TestHuggingFaceModelDeployment:
3333
Tests the complete deployment workflow from ServingRuntime to InferenceService.
3434
"""
3535

36-
@pytest.mark.sanity
36+
@pytest.mark.tier2
3737
def test_huggingface_model_deployment_end_to_end(
3838
self,
3939
admin_client: DynamicClient,

tests/model_registry/model_catalog/huggingface/test_huggingface_negative.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
]
1818

1919

20+
@pytest.mark.tier3
2021
class TestHuggingFaceNegative:
2122
@pytest.mark.parametrize(
2223
"updated_catalog_config_map_scope_function, expected_error_message",

tests/model_registry/model_catalog/metadata/test_catalog_preview.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ def test_catalog_preview_filter_status(
200200
LOGGER.info(f"filterStatus={filter_status} validation passed: {len(items)} items")
201201

202202

203+
@pytest.mark.tier3
203204
class TestCatalogPreviewErrorHandling:
204205
"""
205206
Test class for validating the catalog preview API error handling

tests/model_registry/model_catalog/metadata/test_labels_endpoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_labels_endpoint_default_data(
4141
# Verify they match
4242
verify_labels_match(expected_labels=expected_labels, api_labels=api_labels)
4343

44-
@pytest.mark.sanity
44+
@pytest.mark.tier1
4545
def test_labels_endpoint_configmap_updates(
4646
self,
4747
admin_client: DynamicClient,

tests/model_registry/model_catalog/metadata/test_sources_endpoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TestSourcesEndpoint:
2020
[{"id": REDHAT_AI_CATALOG_ID, "field_name": "enabled", "field_value": False}],
2121
indirect=True,
2222
)
23-
@pytest.mark.smoke
23+
@pytest.mark.tier1
2424
def test_sources_endpoint_returns_all_sources_regardless_of_enabled_field(
2525
self,
2626
sparse_override_catalog_source: dict,

tests/model_registry/model_catalog/rbac/test_catalog_rbac.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@
2525
class TestCatalogRBAC:
2626
"""Test suite for catalog ConfigMap RBAC"""
2727

28-
@pytest.mark.smoke
2928
@pytest.mark.pre_upgrade
3029
@pytest.mark.post_upgrade
3130
@pytest.mark.install
32-
@pytest.mark.parametrize("configmap_name", [DEFAULT_MODEL_CATALOG_CM, DEFAULT_CUSTOM_MODEL_CATALOG])
31+
@pytest.mark.parametrize(
32+
"configmap_name",
33+
[
34+
pytest.param(DEFAULT_MODEL_CATALOG_CM, marks=pytest.mark.smoke),
35+
pytest.param(DEFAULT_CUSTOM_MODEL_CATALOG, marks=pytest.mark.tier1),
36+
],
37+
)
3338
def test_admin_can_read_catalog_configmaps(
3439
self,
3540
admin_client: DynamicClient,
@@ -63,8 +68,13 @@ def test_admin_can_read_catalog_configmaps(
6368

6469
LOGGER.info(f"Admin successfully read ConfigMap '{configmap_name}'")
6570

66-
@pytest.mark.smoke
67-
@pytest.mark.parametrize("configmap_name", [DEFAULT_MODEL_CATALOG_CM, DEFAULT_CUSTOM_MODEL_CATALOG])
71+
@pytest.mark.parametrize(
72+
"configmap_name",
73+
[
74+
pytest.param(DEFAULT_MODEL_CATALOG_CM, marks=pytest.mark.tier1),
75+
pytest.param(DEFAULT_CUSTOM_MODEL_CATALOG, marks=pytest.mark.tier1),
76+
],
77+
)
6878
def test_non_admin_cannot_access_catalog_configmaps(
6979
self,
7080
is_byoidc: bool,

0 commit comments

Comments
 (0)