|
39 | 39 | │ ├── domain_classify.go |
40 | 40 | │ ├── cache.go |
41 | 41 | │ ├── pii_detection.go |
42 | | -│ └── jailbreak_detection.go |
| 42 | +│ ├── jailbreak_detection.go |
| 43 | +│ ├── decision_priority.go # Signal-decision: Priority selection |
| 44 | +│ ├── plugin_chain_execution.go # Signal-decision: Plugin chains |
| 45 | +│ ├── rule_condition_logic.go # Signal-decision: AND/OR operators |
| 46 | +│ ├── decision_fallback.go # Signal-decision: Fallback behavior |
| 47 | +│ ├── keyword_routing.go # Signal-decision: Keyword matching |
| 48 | +│ └── plugin_config_variations.go # Signal-decision: Plugin configs |
43 | 49 | ├── profiles/ |
44 | 50 | │ └── ai-gateway/ # AI Gateway test profile |
45 | 51 | │ └── profile.go # Profile definition and environment setup |
|
50 | 56 |
|
51 | 57 | The framework includes the following test cases (all in `e2e/testcases/`): |
52 | 58 |
|
| 59 | +### Basic Functionality Tests |
| 60 | + |
53 | 61 | | Test Case | Description | Metrics | |
54 | 62 | |-----------|-------------|---------| |
55 | 63 | | `chat-completions-request` | Basic chat completions API test | Response validation | |
56 | 64 | | `chat-completions-stress-request` | Sequential stress test with 1000 requests | Success rate, avg duration | |
57 | 65 | | `chat-completions-progressive-stress` | Progressive QPS stress test (10/20/50/100 QPS) | Per-stage success rate, latency stats | |
| 66 | + |
| 67 | +### Classification and Feature Tests |
| 68 | + |
| 69 | +| Test Case | Description | Metrics | |
| 70 | +|-----------|-------------|---------| |
58 | 71 | | `domain-classify` | Domain classification accuracy | 65 cases, accuracy rate | |
59 | 72 | | `semantic-cache` | Semantic cache hit rate | 5 groups, cache hit rate | |
60 | 73 | | `pii-detection` | PII detection and blocking | 10 PII types, detection rate, block rate | |
61 | 74 | | `jailbreak-detection` | Jailbreak attack detection | 10 attack types, detection rate, block rate | |
62 | 75 |
|
| 76 | +### Signal-Decision Engine Tests |
| 77 | + |
| 78 | +| Test Case | Description | Metrics | |
| 79 | +|-----------|-------------|---------| |
| 80 | +| `decision-priority-selection` | Decision priority selection with multiple matches | 4 cases, priority validation (indirect) | |
| 81 | +| `plugin-chain-execution` | Plugin execution order (PII → Cache → System Prompt) | 4 cases, chain validation, blocking behavior | |
| 82 | +| `rule-condition-logic` | AND/OR operators and keyword matching | 6 cases, operator validation | |
| 83 | +| `decision-fallback-behavior` | Fallback to default decision when no match | 5 cases, fallback validation | |
| 84 | +| `keyword-routing` | Keyword-based routing decisions | 6 cases, keyword matching (case-insensitive) | |
| 85 | +| `plugin-config-variations` | Plugin configuration variations (PII allowlist, cache thresholds) | 6 cases, config validation | |
| 86 | + |
| 87 | +**Signal-Decision Engine Features Tested:** |
| 88 | + |
| 89 | +- ✅ Decision priority selection (priority 15 > 10) - validated by checking which decision wins when multiple match |
| 90 | +- ✅ Plugin chain execution order and blocking |
| 91 | +- ✅ Rule condition logic (AND/OR operators) |
| 92 | +- ✅ Keyword-based routing (case-insensitive) |
| 93 | +- ✅ Decision fallback behavior |
| 94 | +- ✅ Per-decision plugin configurations |
| 95 | +- ✅ PII allowlist handling |
| 96 | +- ✅ Per-decision cache thresholds (0.75, 0.92, 0.95) |
| 97 | + |
63 | 98 | All test cases: |
64 | 99 |
|
65 | | -- Use model name `"MoM"` |
| 100 | +- Use model name `"MoM"` to trigger decision engine |
66 | 101 | - Automatically clean up port forwarding |
67 | 102 | - Generate detailed reports with statistics |
68 | 103 | - Support verbose logging |
@@ -312,6 +347,15 @@ Test data is stored in `e2e/testcases/testdata/` as JSON files. Each test case l |
312 | 347 | - `pii_detection_cases.json`: 10 PII types (email, phone, SSN, etc.) |
313 | 348 | - `jailbreak_detection_cases.json`: 10 attack types (prompt injection, DAN, etc.) |
314 | 349 |
|
| 350 | +**Signal-Decision Engine Tests** use embedded test cases (defined inline in test files) to validate: |
| 351 | + |
| 352 | +- Decision priority mechanisms (4 test cases) |
| 353 | +- Plugin chain execution and blocking (4 test cases) |
| 354 | +- Rule condition logic with AND/OR operators (6 test cases) |
| 355 | +- Decision fallback behavior (5 test cases) |
| 356 | +- Keyword-based routing (6 test cases) |
| 357 | +- Plugin configuration variations (6 test cases) |
| 358 | + |
315 | 359 | **Test Data Format Example:** |
316 | 360 |
|
317 | 361 | ```json |
|
0 commit comments