(t *testing.T)
| 50 | } |
| 51 | |
| 52 | func TestReplayExact_MissingPrimaryBackend(t *testing.T) { |
| 53 | st := requests.NewMemoryStore() |
| 54 | req := types.AIRequest{ |
| 55 | TenantID: "t", |
| 56 | TaskType: "chat", |
| 57 | Priority: "p", |
| 58 | Input: map[string]any{"text": "hi"}, |
| 59 | Options: types.RequestOptions{Stream: false, MaxTokens: 64}, |
| 60 | } |
| 61 | full, _ := json.Marshal(req) |
| 62 | _ = st.CreateRequest(context.Background(), requests.RequestRow{ |
| 63 | RequestID: "rid2", |
| 64 | TenantID: "t", |
| 65 | TaskType: "chat", |
| 66 | Priority: "p", |
| 67 | AIRequestJSON: full, |
| 68 | CreatedAt: time.Now(), |
| 69 | UpdatedAt: time.Now(), |
| 70 | }) |
| 71 | _, err := Replay(context.Background(), &config.Config{}, st, "rid2", ModeExact, Dependencies{}) |
| 72 | if err == nil || !strings.Contains(err.Error(), "missing primary backend") { |
| 73 | t.Fatalf("err=%v", err) |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | func replayTestConfig() *config.Config { |
| 78 | return &config.Config{ |
nothing calls this directly
no test coverage detected