(t *testing.T)
| 158 | } |
| 159 | |
| 160 | func TestLoad_FallbackRuleRequiresTrigger(t *testing.T) { |
| 161 | cfgPath := writeTempConfig(t, ` |
| 162 | backends: |
| 163 | - name: b1 |
| 164 | type: mock |
| 165 | timeout_ms: 100 |
| 166 | cost: { unit: 1, currency: credit } |
| 167 | tenants: |
| 168 | - id: t1 |
| 169 | routing: |
| 170 | default_backend: b1 |
| 171 | reliability: |
| 172 | fallback_enabled: true |
| 173 | fallback_rules: |
| 174 | - from_backend: b1 |
| 175 | fallback_to: b1 |
| 176 | on: [] |
| 177 | `) |
| 178 | |
| 179 | _, err := Load(cfgPath) |
| 180 | if err == nil || !strings.Contains(err.Error(), "must define at least one trigger") { |
| 181 | t.Fatalf("expected fallback trigger validation error, got: %v", err) |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | func TestLoad_FallbackRuleInvalidTrigger(t *testing.T) { |
| 186 | cfgPath := writeTempConfig(t, ` |
nothing calls this directly
no test coverage detected