1313)
1414from tests .model_explainability .guardrails .utils import (
1515 create_detector_config ,
16- check_guardrails_health_endpoint ,
1716 verify_health_info_response ,
1817 send_and_verify_unsuitable_input_detection ,
1918 send_and_verify_unsuitable_output_detection ,
@@ -137,28 +136,14 @@ class TestGuardrailsOrchestratorWithBuiltInDetectors:
137136 query directly to the model without performing any detection.
138137 """
139138
140- def test_guardrails_health_endpoint (
141- self ,
142- current_client_token ,
143- openshift_ca_bundle_file ,
144- llm_d_inference_sim_isvc ,
145- orchestrator_config ,
146- guardrails_orchestrator_health_route ,
147- ):
148- response = check_guardrails_health_endpoint (
149- host = guardrails_orchestrator_health_route .host ,
150- token = current_client_token ,
151- ca_bundle_file = openshift_ca_bundle_file ,
152- )
153- assert "fms-guardrails-orchestr8" in response .text
154-
155139 def test_guardrails_info_endpoint (
156140 self ,
157141 current_client_token ,
158142 openshift_ca_bundle_file ,
159143 llm_d_inference_sim_isvc ,
160144 orchestrator_config ,
161145 guardrails_orchestrator_health_route ,
146+ guardrails_healthcheck ,
162147 ):
163148 verify_health_info_response (
164149 host = guardrails_orchestrator_health_route .host ,
@@ -173,6 +158,7 @@ def test_guardrails_builtin_detectors_unsuitable_input(
173158 llm_d_inference_sim_isvc ,
174159 orchestrator_config ,
175160 guardrails_orchestrator_gateway_route ,
161+ guardrails_healthcheck ,
176162 ):
177163 send_and_verify_unsuitable_input_detection (
178164 url = f"https://{ guardrails_orchestrator_gateway_route .host } { PII_ENDPOINT } { OpenAIEnpoints .CHAT_COMPLETIONS } " ,
@@ -189,6 +175,7 @@ def test_guardrails_builtin_detectors_unsuitable_output(
189175 llm_d_inference_sim_isvc ,
190176 orchestrator_config ,
191177 guardrails_orchestrator_gateway_route ,
178+ guardrails_healthcheck ,
192179 ):
193180 send_and_verify_unsuitable_output_detection (
194181 url = f"https://{ guardrails_orchestrator_gateway_route .host } { PII_ENDPOINT } { OpenAIEnpoints .CHAT_COMPLETIONS } " ,
@@ -218,6 +205,7 @@ def test_guardrails_builtin_detectors_negative_detection(
218205 guardrails_orchestrator_gateway_route ,
219206 message ,
220207 url_path ,
208+ guardrails_healthcheck ,
221209 ):
222210 send_and_verify_negative_detection (
223211 url = f"https://{ guardrails_orchestrator_gateway_route .host } { url_path } { OpenAIEnpoints .CHAT_COMPLETIONS } " ,
@@ -331,6 +319,7 @@ def test_guardrails_multi_detector_unsuitable_input(
331319 guardrails_orchestrator ,
332320 otel_collector ,
333321 tempo_stack ,
322+ guardrails_healthcheck ,
334323 ):
335324 for prompt in [PROMPT_INJECTION_INPUT_DETECTION_PROMPT , HAP_INPUT_DETECTION_PROMPT ]:
336325 send_and_verify_unsuitable_input_detection (
@@ -353,6 +342,7 @@ def test_guardrails_multi_detector_negative_detection(
353342 openshift_ca_bundle_file ,
354343 otel_collector ,
355344 tempo_stack ,
345+ guardrails_healthcheck ,
356346 ):
357347 send_and_verify_negative_detection (
358348 url = f"https://{ guardrails_orchestrator_route .host } /{ CHAT_COMPLETIONS_DETECTION_ENDPOINT } " ,
@@ -373,6 +363,7 @@ def test_guardrails_standalone_detector_endpoint(
373363 hap_detector_route ,
374364 otel_collector ,
375365 tempo_stack ,
366+ guardrails_healthcheck ,
376367 ):
377368 send_and_verify_standalone_detection (
378369 url = f"https://{ guardrails_orchestrator_route .host } /{ STANDALONE_DETECTION_ENDPOINT } " ,
@@ -393,6 +384,7 @@ def test_guardrails_traces_in_tempo(
393384 otel_collector ,
394385 tempo_stack ,
395386 tempo_traces_service_portforward ,
387+ guardrails_healthcheck ,
396388 ):
397389 """
398390 Ensure that OpenTelemetry traces from Guardrails Orchestrator are collected in Tempo.
@@ -437,29 +429,13 @@ class TestGuardrailsOrchestratorAutoConfig:
437429 These tests verify that the GuardrailsOrchestrator works as expected when configured through the AutoConfig feature.
438430 """
439431
440- def test_guardrails_gateway_health_endpoint (
441- self ,
442- current_client_token ,
443- llm_d_inference_sim_isvc ,
444- prompt_injection_detector_route ,
445- hap_detector_route ,
446- openshift_ca_bundle_file ,
447- guardrails_orchestrator ,
448- guardrails_orchestrator_health_route ,
449- ):
450- response = check_guardrails_health_endpoint (
451- host = guardrails_orchestrator_health_route .host ,
452- token = current_client_token ,
453- ca_bundle_file = openshift_ca_bundle_file ,
454- )
455- assert "fms-guardrails-orchestr8" in response .text
456-
457432 def test_guardrails_gateway_info_endpoint (
458433 self ,
459434 current_client_token ,
460435 openshift_ca_bundle_file ,
461436 llm_d_inference_sim_isvc ,
462437 guardrails_orchestrator_health_route ,
438+ guardrails_healthcheck ,
463439 ):
464440 verify_health_info_response (
465441 host = guardrails_orchestrator_health_route .host ,
@@ -473,6 +449,7 @@ def test_guardrails_autoconfig_unsuitable_input(
473449 openshift_ca_bundle_file ,
474450 llm_d_inference_sim_isvc ,
475451 guardrails_orchestrator_route ,
452+ guardrails_healthcheck ,
476453 ):
477454 for prompt in [HAP_INPUT_DETECTION_PROMPT , PROMPT_INJECTION_INPUT_DETECTION_PROMPT ]:
478455 send_and_verify_unsuitable_input_detection (
@@ -490,6 +467,7 @@ def test_guardrails_autoconfig_negative_detection(
490467 llm_d_inference_sim_isvc ,
491468 guardrails_orchestrator_route ,
492469 openshift_ca_bundle_file ,
470+ guardrails_healthcheck ,
493471 ):
494472 send_and_verify_negative_detection (
495473 url = f"https://{ guardrails_orchestrator_route .host } /{ CHAT_COMPLETIONS_DETECTION_ENDPOINT } " ,
@@ -526,29 +504,15 @@ class TestGuardrailsOrchestratorAutoConfigWithGateway:
526504 through the AutoConfig feature to use the gateway route.
527505 """
528506
529- def test_guardrails_autoconfig_gateway_health_endpoint (
530- self ,
531- current_client_token ,
532- llm_d_inference_sim_isvc ,
533- prompt_injection_detector_route ,
534- hap_detector_route ,
535- openshift_ca_bundle_file ,
536- guardrails_orchestrator ,
537- guardrails_orchestrator_health_route ,
538- ):
539- response = check_guardrails_health_endpoint (
540- host = guardrails_orchestrator_health_route .host ,
541- token = current_client_token ,
542- ca_bundle_file = openshift_ca_bundle_file ,
543- )
544- assert "fms-guardrails-orchestr8" in response .text
545-
546507 def test_guardrails_autoconfig_gateway_info_endpoint (
547508 self ,
548509 current_client_token ,
549510 openshift_ca_bundle_file ,
550511 llm_d_inference_sim_isvc ,
512+ hap_detector_isvc ,
513+ prompt_injection_detector_isvc ,
551514 guardrails_orchestrator_health_route ,
515+ guardrails_healthcheck ,
552516 ):
553517 verify_health_info_response (
554518 host = guardrails_orchestrator_health_route .host ,
@@ -561,7 +525,10 @@ def test_guardrails_autoconfig_gateway_unsuitable_input(
561525 current_client_token ,
562526 openshift_ca_bundle_file ,
563527 llm_d_inference_sim_isvc ,
528+ prompt_injection_detector_isvc ,
529+ hap_detector_isvc ,
564530 guardrails_orchestrator_gateway_route ,
531+ guardrails_healthcheck ,
565532 ):
566533 for prompt in [HAP_INPUT_DETECTION_PROMPT , PROMPT_INJECTION_INPUT_DETECTION_PROMPT ]:
567534 send_and_verify_unsuitable_input_detection (
@@ -588,10 +555,13 @@ def test_guardrails_autoconfig_gateway_negative_detection(
588555 self ,
589556 current_client_token ,
590557 llm_d_inference_sim_isvc ,
558+ prompt_injection_detector_isvc ,
559+ hap_detector_isvc ,
591560 guardrails_orchestrator_gateway_route ,
592561 openshift_ca_bundle_file ,
593562 url_path ,
594563 message ,
564+ guardrails_healthcheck ,
595565 ):
596566 send_and_verify_negative_detection (
597567 url = f"https://{ guardrails_orchestrator_gateway_route .host } { url_path } { OpenAIEnpoints .CHAT_COMPLETIONS } " ,
0 commit comments