Skip to content

Commit 9a8b631

Browse files
jiripetrliksheltoncyril
authored andcommitted
RHAIENG-534 - RAG tests run without cluster-admin permissions (opendatahub-io#651)
1 parent 3b072d5 commit 9a8b631

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

tests/llama_stack/conftest.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ def enabled_llama_stack_operator(dsc_resource: DataScienceCluster) -> Generator[
4040
@pytest.fixture(scope="class")
4141
def llama_stack_server_config(
4242
request: FixtureRequest,
43-
admin_client: DynamicClient,
44-
model_namespace: Namespace,
43+
unprivileged_model_namespace: Namespace,
4544
) -> Dict[str, Any]:
4645
fms_orchestrator_url = "http://localhost"
4746
inference_model = os.getenv("LLS_CORE_INFERENCE_MODEL", "")
@@ -100,15 +99,15 @@ def llama_stack_server_config(
10099

101100
@pytest.fixture(scope="class")
102101
def llama_stack_distribution(
103-
admin_client: DynamicClient,
104-
model_namespace: Namespace,
102+
unprivileged_client: DynamicClient,
103+
unprivileged_model_namespace: Namespace,
105104
enabled_llama_stack_operator: DataScienceCluster,
106105
llama_stack_server_config: Dict[str, Any],
107106
) -> Generator[LlamaStackDistribution, None, None]:
108107
with create_llama_stack_distribution(
109-
client=admin_client,
108+
client=unprivileged_client,
110109
name="test-lama-stack-distribution",
111-
namespace=model_namespace.name,
110+
namespace=unprivileged_model_namespace.name,
112111
replicas=1,
113112
server=llama_stack_server_config,
114113
) as lls_dist:
@@ -118,11 +117,11 @@ def llama_stack_distribution(
118117

119118
@pytest.fixture(scope="class")
120119
def llama_stack_distribution_deployment(
121-
admin_client: DynamicClient,
120+
unprivileged_client: DynamicClient,
122121
llama_stack_distribution: LlamaStackDistribution,
123122
) -> Generator[Deployment, Any, Any]:
124123
deployment = Deployment(
125-
client=admin_client,
124+
client=unprivileged_client,
126125
namespace=llama_stack_distribution.namespace,
127126
name=llama_stack_distribution.name,
128127
)
@@ -133,15 +132,13 @@ def llama_stack_distribution_deployment(
133132

134133
@pytest.fixture(scope="class")
135134
def llama_stack_client(
136-
admin_client: DynamicClient,
137135
llama_stack_distribution_deployment: Deployment,
138136
) -> Generator[LlamaStackClient, Any, Any]:
139137
"""
140138
Returns a ready to use LlamaStackClient, enabling port forwarding
141139
from the llama-stack-server service:8321 to localhost:8321
142140
143141
Args:
144-
admin_client (DynamicClient): Kubernetes dynamic client for cluster operations
145142
llama_stack_distribution_deployment (Deployment): LlamaStack distribution deployment resource
146143
147144
Yields:

tests/llama_stack/rag/test_rag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
@pytest.mark.parametrize(
17-
"model_namespace, llama_stack_server_config",
17+
"unprivileged_model_namespace, llama_stack_server_config",
1818
[
1919
pytest.param(
2020
{"name": "test-llamastack-rag"},

0 commit comments

Comments
 (0)