(t *testing.T)
| 218 | } |
| 219 | |
| 220 | func TestReplayCurrent_InferenceSuccess(t *testing.T) { |
| 221 | cfg := replayTestConfig() |
| 222 | st := requests.NewMemoryStore() |
| 223 | req := types.AIRequest{ |
| 224 | TenantID: "team-a", |
| 225 | TaskType: "chat", |
| 226 | Priority: "high", |
| 227 | Input: map[string]any{"text": "replay hi"}, |
| 228 | Options: types.RequestOptions{Stream: false, MaxTokens: 64}, |
| 229 | } |
| 230 | full, _ := json.Marshal(req) |
| 231 | _ = st.CreateRequest(context.Background(), requests.RequestRow{ |
| 232 | RequestID: "rid3", |
| 233 | TenantID: req.TenantID, |
| 234 | TaskType: req.TaskType, |
| 235 | Priority: req.Priority, |
| 236 | AIRequestJSON: full, |
| 237 | CreatedAt: time.Now(), |
| 238 | UpdatedAt: time.Now(), |
| 239 | }) |
| 240 | ad := mock.New(cfg.Backends[0]) |
| 241 | deps := NewDependenciesFromConfig(cfg, map[string]interfaces.BackendAdapter{ |
| 242 | "small-model": ad, |
| 243 | }, nil) |
| 244 | resp, err := Replay(context.Background(), cfg, st, "rid3", ModeCurrent, deps) |
| 245 | if err != nil { |
| 246 | t.Fatalf("replay: %v", err) |
| 247 | } |
| 248 | if resp.Status != "success" { |
| 249 | t.Fatalf("status=%q", resp.Status) |
| 250 | } |
| 251 | if resp.SelectedBackend != "small-model" { |
| 252 | t.Fatalf("backend=%q", resp.SelectedBackend) |
| 253 | } |
| 254 | } |
nothing calls this directly
no test coverage detected