Skip to content

Commit 458bf29

Browse files
committed
tests(maas-billing): added fixtures
1 parent 8e20dcd commit 458bf29

File tree

1 file changed

+18
-24
lines changed
  • tests/model_serving/model_server/maas_billing

1 file changed

+18
-24
lines changed

tests/model_serving/model_server/maas_billing/conftest.py

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -72,37 +72,18 @@ def minted_token(request_session_http, base_url: str, current_client_token: str)
7272

7373

7474
@pytest.fixture(scope="class")
75-
def base_url(
76-
admin_client: DynamicClient,
77-
unprivileged_model_namespace: Namespace,
78-
) -> str:
79-
# ns = unprivileged_model_namespace.name
80-
scheme = detect_scheme_via_llmisvc(
81-
client=admin_client,
82-
namespace=unprivileged_model_namespace.name,
83-
)
84-
host = host_from_ingress_domain(client=admin_client)
85-
return f"{scheme}://{host}/maas-api"
75+
def base_url(maas_scheme: str, maas_host: str) -> str:
76+
return f"{maas_scheme}://{maas_host}/maas-api"
8677

8778

8879
@pytest.fixture(scope="class")
8980
def model_url(
81+
maas_scheme: str,
82+
maas_host: str,
9083
admin_client: DynamicClient,
91-
unprivileged_model_namespace: Namespace,
92-
maas_inference_service_tinyllama: LLMInferenceService,
9384
) -> str:
94-
"""
95-
MODEL_URL:http(s)://<host>/llm/<deployment>/v1/chat/completions
96-
97-
"""
98-
ns = unprivileged_model_namespace.name
99-
scheme = detect_scheme_via_llmisvc(
100-
client=admin_client,
101-
namespace=ns,
102-
)
103-
host = host_from_ingress_domain(client=admin_client)
10485
deployment = llmis_name(client=admin_client)
105-
return f"{scheme}://{host}/llm/{deployment}{CHAT_COMPLETIONS}"
86+
return f"{maas_scheme}://{maas_host}/llm/{deployment}{CHAT_COMPLETIONS}"
10687

10788

10889
@pytest.fixture
@@ -539,3 +520,16 @@ def maas_inference_service_tinyllama(
539520
f"{llm_service.namespace}/{llm_service.name} "
540521
f"will be deleted at teardown"
541522
)
523+
524+
525+
@pytest.fixture(scope="class")
526+
def maas_scheme(admin_client: DynamicClient, unprivileged_model_namespace: Namespace) -> str:
527+
return detect_scheme_via_llmisvc(
528+
client=admin_client,
529+
namespace=unprivileged_model_namespace.name,
530+
)
531+
532+
533+
@pytest.fixture(scope="session")
534+
def maas_host(admin_client):
535+
return host_from_ingress_domain(client=admin_client)

0 commit comments

Comments
 (0)