Skip to content

Commit 0ba3985

Browse files
author
Yehudit Kerido
committed
fix wrong header in test
Signed-off-by: Yehudit Kerido <[email protected]>
1 parent 03b5f9c commit 0ba3985

File tree

5 files changed

+15
-28
lines changed

5 files changed

+15
-28
lines changed

deploy/kubernetes/aibrix/semantic-router-values/values.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ config:
3535
- name: computer science
3636
- name: philosophy
3737
- name: engineering
38-
- name: thinking
3938

4039
# Decisions - define routing logic with rules, model selection, and plugins
4140
decisions:
@@ -365,8 +364,6 @@ config:
365364
rules:
366365
operator: "OR"
367366
conditions:
368-
- type: "domain"
369-
name: "thinking"
370367
- type: "keyword"
371368
name: "thinking"
372369
modelRefs:

e2e/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ The framework includes the following test cases (all in `e2e/testcases/`):
7777

7878
| Test Case | Description | Metrics |
7979
|-----------|-------------|---------|
80-
| `decision-priority-selection` | Decision priority selection with multiple matches | 4 cases, priority validation |
80+
| `decision-priority-selection` | Decision priority selection with multiple matches | 4 cases, priority validation (indirect) |
8181
| `plugin-chain-execution` | Plugin execution order (PII → Cache → System Prompt) | 4 cases, chain validation, blocking behavior |
8282
| `rule-condition-logic` | AND/OR operators and keyword matching | 6 cases, operator validation |
8383
| `decision-fallback-behavior` | Fallback to default decision when no match | 5 cases, fallback validation |
@@ -86,7 +86,7 @@ The framework includes the following test cases (all in `e2e/testcases/`):
8686

8787
**Signal-Decision Engine Features Tested:**
8888

89-
- ✅ Decision priority selection (priority 15 > 10)
89+
- ✅ Decision priority selection (priority 15 > 10) - validated by checking which decision wins when multiple match
9090
- ✅ Plugin chain execution order and blocking
9191
- ✅ Rule condition logic (AND/OR operators)
9292
- ✅ Keyword-based routing (case-insensitive)

e2e/profiles/dynamic-config/crds/intelligentroute.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,14 @@ spec:
3232
description: "Philosophy and ethical questions"
3333
- name: "engineering"
3434
description: "Engineering and technical problem-solving"
35-
- name: "thinking"
36-
description: "Queries requiring careful thought or urgent attention"
3735
- name: "other"
3836
description: "General knowledge and miscellaneous topics"
3937

4038
keywords:
4139
- name: "thinking"
4240
operator: "OR"
4341
keywords: ["urgent", "immediate", "asap", "think", "careful"]
44-
case_sensitive: false
42+
caseSensitive: false
4543

4644
decisions:
4745
- name: "thinking_decision"
@@ -50,8 +48,6 @@ spec:
5048
signals:
5149
operator: "OR"
5250
conditions:
53-
- type: "domain"
54-
name: "thinking"
5551
- type: "keyword"
5652
name: "thinking"
5753
modelRefs:
@@ -400,5 +396,5 @@ spec:
400396
- type: "system_prompt"
401397
configuration:
402398
enabled: true
403-
system_prompt: "You are an engineering expert with knowledge across multiple engineering disciplines including mechanical, electrical, civil, chemical, software, and systems engineering. Apply engineering principles, design methodologies, and problem-solving approaches to provide practical solutions. Consider safety, efficiency, sustainability, and cost-effectiveness in your recommendations. Use technical precision while explaining concepts clearly, and emphasize the importance of proper engineering practices and standards."
399+
system_prompt: "You are a knowledgeable AI assistant with broad expertise across many domains. Provide accurate, helpful, and well-structured responses to general questions. When uncertain, acknowledge limitations and suggest where to find authoritative information."
404400
mode: "replace"

e2e/testcases/decision_priority.go

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -182,28 +182,21 @@ func testSinglePrioritySelection(ctx context.Context, testCase DecisionPriorityC
182182

183183
// Extract VSR decision headers
184184
result.ActualDecision = resp.Header.Get("x-vsr-selected-decision")
185-
result.ActualPriority = resp.Header.Get("x-vsr-decision-priority")
186185

187186
// Check if the highest priority decision was selected
188-
// Validate both decision name AND priority value
189-
decisionMatches := (result.ActualDecision == testCase.ExpectedDecision)
190-
priorityMatches := (result.ActualPriority == fmt.Sprintf("%d", testCase.ExpectedPriority))
191-
result.Correct = decisionMatches && priorityMatches
187+
// Note: We validate priority indirectly by checking which decision "wins"
188+
// when multiple decisions match. The x-vsr-decision-priority header is not
189+
// currently implemented in semantic-router backend.
190+
result.Correct = (result.ActualDecision == testCase.ExpectedDecision)
192191

193192
if verbose {
194193
if result.Correct {
195-
fmt.Printf("[Test] ✓ Correct priority selection: %s (priority %s)\n", result.ActualDecision, result.ActualPriority)
194+
fmt.Printf("[Test] ✓ Correct priority selection: %s\n", result.ActualDecision)
196195
} else {
197-
fmt.Printf("[Test] ✗ Wrong decision or priority\n")
196+
fmt.Printf("[Test] ✗ Wrong decision selected\n")
198197
fmt.Printf(" Query: %s\n", testCase.Query)
199198
fmt.Printf(" Expected: %s (priority %d)\n", testCase.ExpectedDecision, testCase.ExpectedPriority)
200-
fmt.Printf(" Actual: %s (priority %s)\n", result.ActualDecision, result.ActualPriority)
201-
if !decisionMatches {
202-
fmt.Printf(" ⚠ Decision mismatch\n")
203-
}
204-
if !priorityMatches {
205-
fmt.Printf(" ⚠ Priority mismatch\n")
206-
}
199+
fmt.Printf(" Actual: %s\n", result.ActualDecision)
207200
fmt.Printf(" Description: %s\n", testCase.Description)
208201
}
209202
}
@@ -235,7 +228,7 @@ func printDecisionPriorityResults(results []DecisionPriorityResult, totalTests,
235228
if !result.Correct && result.Error == "" {
236229
fmt.Printf(" - Query: %s\n", result.Query)
237230
fmt.Printf(" Expected Decision: %s (priority %d)\n", result.ExpectedDecision, result.ExpectedPriority)
238-
fmt.Printf(" Actual Decision: %s (priority %s)\n", result.ActualDecision, result.ActualPriority)
231+
fmt.Printf(" Actual Decision: %s\n", result.ActualDecision)
239232
}
240233
}
241234
}

e2e/testcases/plugin_chain_execution.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ func testSinglePluginChain(ctx context.Context, testCase PluginChainCase, localP
180180
result.StatusCode = resp.StatusCode
181181

182182
// Extract plugin execution headers
183-
result.PIIDetected = resp.Header.Get("x-vsr-pii-detected")
184-
result.PIIBlocked = (resp.StatusCode == http.StatusForbidden || result.PIIDetected != "")
183+
piiViolationHeader := resp.Header.Get("x-vsr-pii-violation")
184+
result.PIIDetected = piiViolationHeader // Store for display purposes
185+
result.PIIBlocked = (resp.StatusCode == http.StatusForbidden || piiViolationHeader == "true")
185186

186187
// Check cache headers (x-vsr-cache-hit or similar)
187188
cacheHeader := resp.Header.Get("x-vsr-cache-hit")

0 commit comments

Comments
 (0)