( ctx context.Context, t *testing.T, db database.Store, chatID uuid.UUID, )
| 6177 | } |
| 6178 | |
| 6179 | func waitForTerminalChat( |
| 6180 | ctx context.Context, |
| 6181 | t *testing.T, |
| 6182 | db database.Store, |
| 6183 | chatID uuid.UUID, |
| 6184 | ) database.Chat { |
| 6185 | t.Helper() |
| 6186 | |
| 6187 | var chatResult database.Chat |
| 6188 | testutil.Eventually(ctx, t, func(ctx context.Context) bool { |
| 6189 | got, err := db.GetChatByID(ctx, chatID) |
| 6190 | if err != nil { |
| 6191 | return false |
| 6192 | } |
| 6193 | chatResult = got |
| 6194 | return got.Status == database.ChatStatusWaiting || got.Status == database.ChatStatusError |
| 6195 | }, testutil.IntervalFast) |
| 6196 | |
| 6197 | return chatResult |
| 6198 | } |
| 6199 | |
| 6200 | func insertChatModelConfigWithCallConfig( |
| 6201 | t *testing.T, |
no test coverage detected