Skip to content

Commit d61eeeb

Browse files
yossiovadiaclaude
andcommitted
fix(e2e): make PII test model name configurable via environment variable
The PII detection E2E test was hardcoding "model": "general-expert" in the chat completions request, which caused failures in deployments that use different model names (e.g., aibrix uses "vllm-llama3-8b-instruct"). This commit makes the model name configurable via the E2E_TEST_MODEL environment variable, while maintaining backward compatibility by defaulting to "general-expert" for existing profiles (ai-gateway, dynamic-config). Changes: - Add E2E_TEST_MODEL environment variable support in pii_detection.go - Default to "general-expert" when E2E_TEST_MODEL is not set - Enable future profiles (e.g., aibrix) to specify custom model names Testing: - Tested locally with dynamic-config profile: 100/100 tests passed (100% accuracy) - Tested locally with ai-gateway profile: 100/100 tests passed (100% accuracy) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Yossi Ovadia <yovadia@redhat.com>
1 parent 8df29e7 commit d61eeeb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

e2e/testcases/pii_detection.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,15 @@ func testSinglePIIDetection(ctx context.Context, testCase PIITestCase, localPort
133133
ExpectedBlocked: testCase.ExpectedBlocked,
134134
}
135135

136+
// Get model name from environment, default to "general-expert" for backward compatibility
137+
modelName := os.Getenv("E2E_TEST_MODEL")
138+
if modelName == "" {
139+
modelName = "general-expert"
140+
}
141+
136142
// Create chat completion request
137143
requestBody := map[string]interface{}{
138-
"model": "general-expert",
144+
"model": modelName,
139145
"messages": []map[string]string{
140146
{"role": "user", "content": testCase.Question},
141147
},

0 commit comments

Comments
 (0)