Skip to content

Commit a87e1ca

Browse files
committed
Added docstring for orchestrator_config_gpu
Signed-off-by: Sandeep20013 <sandeepm20013@gmail.com>
1 parent 030dc94 commit a87e1ca

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

tests/fixtures/guardrails.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,28 @@ def orchestrator_config_gpu(
235235
teardown_resources: bool,
236236
pytestconfig: pytest.Config,
237237
) -> Generator[ConfigMap, Any, Any]:
238-
238+
"""
239+
Fixture for creating and managing the Guardrails Orchestrator ConfigMap.
240+
241+
This fixture dynamically generates the orchestrator configuration used in tests,
242+
including detector setup and OpenAI/vLLM integration. It supports both built-in
243+
detectors and external HuggingFace-based detectors depending on test parameters.
244+
245+
Args:
246+
request: Pytest request object used to access parametrization
247+
admin_client: Kubernetes client for resource management
248+
model_namespace: Namespace where resources are deployed
249+
teardown_resources: Whether to clean up resources after test execution
250+
pytestconfig: Pytest configuration (used for post-upgrade handling)
251+
252+
Returns:
253+
Generator[ConfigMap, Any, Any]: ConfigMap containing orchestrator configuration
254+
255+
Behavior:
256+
- Reuses existing ConfigMap in post-upgrade scenarios
257+
- Uses built-in detectors if `use_builtin_detectors` is set
258+
- Otherwise configures external detectors (e.g., prompt injection, HAP)
259+
"""
239260
if pytestconfig.option.post_upgrade:
240261
cm = ConfigMap(
241262
client=admin_client,

0 commit comments

Comments
 (0)