11import pytest
22from dictdiffer import diff
3-
3+ from ocp_resources . config_map import ConfigMap
44from simple_logger .logger import get_logger
55from typing import Self , Any
66from tests .model_registry .model_catalog .constants import (
3232class TestSearchModelCatalog :
3333 @pytest .mark .smoke
3434 def test_search_model_catalog_source_label (
35- self : Self , model_catalog_rest_url : list [str ], model_registry_rest_headers : dict [str , str ]
35+ self : Self ,
36+ enabled_model_catalog_config_map : ConfigMap ,
37+ model_catalog_rest_url : list [str ],
38+ model_registry_rest_headers : dict [str , str ],
3639 ):
3740 """
3841 RHOAIENG-33656: Validate search model catalog by source label
@@ -61,7 +64,10 @@ def test_search_model_catalog_source_label(
6164 assert redhat_ai_filter_moldels_size + redhat_ai_validated_filter_models_size == both_filtered_models_size
6265
6366 def test_search_model_catalog_invalid_source_label (
64- self : Self , model_catalog_rest_url : list [str ], model_registry_rest_headers : dict [str , str ]
67+ self : Self ,
68+ enabled_model_catalog_config_map : ConfigMap ,
69+ model_catalog_rest_url : list [str ],
70+ model_registry_rest_headers : dict [str , str ],
6571 ):
6672 """
6773 RHOAIENG-33656:
@@ -102,6 +108,7 @@ def test_search_model_catalog_invalid_source_label(
102108 )
103109 def test_search_model_catalog_match (
104110 self : Self ,
111+ enabled_model_catalog_config_map : ConfigMap ,
105112 model_catalog_rest_url : list [str ],
106113 model_registry_rest_headers : dict [str , str ],
107114 randomly_picked_model_from_catalog_api_by_source : tuple [dict [Any , Any ], str , str ],
@@ -145,6 +152,7 @@ class TestSearchModelArtifact:
145152 )
146153 def test_validate_model_artifacts_by_artifact_type (
147154 self : Self ,
155+ enabled_model_catalog_config_map : ConfigMap ,
148156 model_catalog_rest_url : list [str ],
149157 model_registry_rest_headers : dict [str , str ],
150158 randomly_picked_model_from_catalog_api_by_source : tuple [dict [Any , Any ], str , str ],
@@ -210,6 +218,7 @@ def test_validate_model_artifacts_by_artifact_type(
210218 )
211219 def test_error_handled_for_invalid_artifact_type (
212220 self : Self ,
221+ enabled_model_catalog_config_map : ConfigMap ,
213222 model_catalog_rest_url : list [str ],
214223 model_registry_rest_headers : dict [str , str ],
215224 randomly_picked_model_from_catalog_api_by_source : tuple [dict [Any , Any ], str , str ],
@@ -248,6 +257,7 @@ def test_error_handled_for_invalid_artifact_type(
248257 )
249258 def test_multiple_artifact_type_filtering (
250259 self : Self ,
260+ enabled_model_catalog_config_map : ConfigMap ,
251261 model_catalog_rest_url : list [str ],
252262 model_registry_rest_headers : dict [str , str ],
253263 randomly_picked_model_from_catalog_api_by_source : tuple [dict [Any , Any ], str , str ],
@@ -299,6 +309,7 @@ class TestSearchModelCatalogQParameter:
299309 )
300310 def test_q_parameter_basic_search (
301311 self : Self ,
312+ enabled_model_catalog_config_map : ConfigMap ,
302313 search_term : str ,
303314 model_catalog_rest_url : list [str ],
304315 model_registry_rest_headers : dict [str , str ],
@@ -338,6 +349,7 @@ def test_q_parameter_basic_search(
338349 )
339350 def test_q_parameter_case_insensitive (
340351 self : Self ,
352+ enabled_model_catalog_config_map : ConfigMap ,
341353 search_term : str ,
342354 case_variant : str ,
343355 model_catalog_rest_url : list [str ],
@@ -388,6 +400,7 @@ def test_q_parameter_case_insensitive(
388400
389401 def test_q_parameter_no_results (
390402 self : Self ,
403+ enabled_model_catalog_config_map : ConfigMap ,
391404 model_catalog_rest_url : list [str ],
392405 model_registry_rest_headers : dict [str , str ],
393406 model_registry_namespace : str ,
@@ -417,6 +430,7 @@ def test_q_parameter_no_results(
417430 def test_q_parameter_empty_query (
418431 self : Self ,
419432 search_term ,
433+ enabled_model_catalog_config_map : ConfigMap ,
420434 model_catalog_rest_url : list [str ],
421435 model_registry_rest_headers : dict [str , str ],
422436 ):
@@ -434,6 +448,7 @@ def test_q_parameter_empty_query(
434448
435449 def test_q_parameter_with_source_label_filter (
436450 self : Self ,
451+ enabled_model_catalog_config_map : ConfigMap ,
437452 model_catalog_rest_url : list [str ],
438453 model_registry_rest_headers : dict [str , str ],
439454 ):
@@ -479,6 +494,7 @@ def test_q_parameter_with_source_label_filter(
479494class TestSearchModelsByFilterQuery :
480495 def test_search_models_by_filter_query (
481496 self : Self ,
497+ enabled_model_catalog_config_map : ConfigMap ,
482498 model_catalog_rest_url : list [str ],
483499 model_registry_rest_headers : dict [str , str ],
484500 model_registry_namespace : str ,
@@ -524,6 +540,7 @@ def test_search_models_by_filter_query(
524540
525541 def test_search_models_by_invalid_filter_query (
526542 self : Self ,
543+ enabled_model_catalog_config_map : ConfigMap ,
527544 model_catalog_rest_url : list [str ],
528545 model_registry_rest_headers : dict [str , str ],
529546 model_registry_namespace : str ,
@@ -563,6 +580,7 @@ def test_search_models_by_invalid_filter_query(
563580 @pytest .mark .downstream_only
564581 def test_presence_performance_data_on_pod (
565582 self : Self ,
583+ enabled_model_catalog_config_map : ConfigMap ,
566584 admin_client : DynamicClient ,
567585 model_registry_namespace : str ,
568586 ):
0 commit comments