Skip to content

Commit 0cb829a

Browse files
committed
Address Review Comments-py_config[applications_namespace]
1 parent 83ff6a1 commit 0cb829a

File tree

1 file changed

+4
-43
lines changed
  • tests/model_serving/model_server/maas_billing

1 file changed

+4
-43
lines changed

tests/model_serving/model_server/maas_billing/conftest.py

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def minted_token(
7171
request_session_http,
7272
base_url: str,
7373
current_client_token: str,
74-
maas_control_plane_namespace: str,
7574
maas_controller_enabled_latest: None,
7675
maas_gateway_api: None,
7776
maas_request_ratelimit_policy: None,
@@ -454,7 +453,6 @@ def maas_token_for_actor(
454453
request_session_http: requests.Session,
455454
base_url: str,
456455
ocp_token_for_actor: str,
457-
maas_control_plane_namespace: str,
458456
maas_controller_enabled_latest: None,
459457
maas_gateway_api: None,
460458
maas_api_gateway_reachable: None,
@@ -560,7 +558,6 @@ def maas_inference_service_tinyllama(
560558
admin_client: DynamicClient,
561559
unprivileged_model_namespace: Namespace,
562560
model_service_account: ServiceAccount,
563-
maas_control_plane_namespace: str,
564561
maas_gateway_api: None,
565562
maas_request_ratelimit_policy: None,
566563
maas_token_ratelimit_policy: None,
@@ -670,53 +667,19 @@ def maas_controller_enabled_latest(
670667
dsc_resource.wait_for_condition(condition="Ready", status="True", timeout=600)
671668

672669

673-
# @pytest.fixture(scope="session")
674-
# def maas_control_plane_namespace(admin_client: DynamicClient) -> str:
675-
# """
676-
# MaaS control-plane namespace is defined by the global pytest config.
677-
# It is either 'redhat-ods-applications' or 'opendatahub', never both.
678-
# """
679-
# namespace = py_config["applications_namespace"]
680-
681-
# ns = Namespace(
682-
# client=admin_client,
683-
# name=namespace,
684-
# ensure_exists=True,
685-
# )
686-
687-
# return namespace
688-
689-
690-
@pytest.fixture(scope="session")
691-
def maas_control_plane_namespace(admin_client: DynamicClient) -> str:
692-
"""
693-
MaaS control-plane namespace is defined by the global pytest config.
694-
"""
695-
namespace = py_config["applications_namespace"]
696-
697-
Namespace(
698-
client=admin_client,
699-
name=namespace,
700-
ensure_exists=True,
701-
)
702-
703-
return namespace
704-
705-
706670
@pytest.fixture(scope="session")
707671
def maas_tier_mapping_cm(
708672
admin_client: DynamicClient,
709-
maas_control_plane_namespace: str,
710673
) -> ConfigMap:
711674
config_map = ConfigMap(
712675
client=admin_client,
713676
name="tier-to-group-mapping",
714-
namespace=maas_control_plane_namespace,
677+
namespace=py_config["applications_namespace"],
715678
ensure_exists=True,
716679
)
717680

718681
LOGGER.info(
719-
f"MaaS tier mapping ConfigMap detected: namespace={maas_control_plane_namespace}, name={config_map.name}"
682+
f"MaaS tier mapping ConfigMap detected: namespace={py_config['applications_namespace']}, name={config_map.name}"
720683
)
721684

722685
return config_map
@@ -725,12 +688,11 @@ def maas_tier_mapping_cm(
725688
@pytest.fixture(scope="class")
726689
def maas_api_deployment_available(
727690
admin_client: DynamicClient,
728-
maas_control_plane_namespace: str,
729691
) -> None:
730692
maas_api_deployment = Deployment(
731693
client=admin_client,
732694
name="maas-api",
733-
namespace=maas_control_plane_namespace,
695+
namespace=py_config["applications_namespace"],
734696
ensure_exists=True,
735697
)
736698
maas_api_deployment.wait_for_condition(
@@ -743,15 +705,14 @@ def maas_api_deployment_available(
743705
@pytest.fixture(scope="class")
744706
def maas_api_endpoints_ready(
745707
admin_client: DynamicClient,
746-
maas_control_plane_namespace: str,
747708
maas_api_deployment_available: None,
748709
) -> None:
749710
for ready in TimeoutSampler(
750711
wait_timeout=300,
751712
sleep=5,
752713
func=endpoints_have_ready_addresses,
753714
admin_client=admin_client,
754-
namespace=maas_control_plane_namespace,
715+
namespace=py_config["applications_namespace"],
755716
name="maas-api",
756717
):
757718
if ready:

0 commit comments

Comments
 (0)