MCPcopy Create free account
hub / github.com/coder/coder / seedRemoteRunningChat

Function seedRemoteRunningChat

enterprise/coderd/x/chatd/chatd_test.go:162–185  ·  view source on GitHub ↗
(
	ctx context.Context,
	t *testing.T,
	db database.Store,
	orgID uuid.UUID,
	user database.User,
	model database.ChatModelConfig,
	workerID uuid.UUID,
	title string,
)

Source from the content-addressed store, hash-verified

160}
161
162func seedRemoteRunningChat(
163 ctx context.Context,
164 t *testing.T,
165 db database.Store,
166 orgID uuid.UUID,
167 user database.User,
168 model database.ChatModelConfig,
169 workerID uuid.UUID,
170 title string,
171) database.Chat {
172 t.Helper()
173
174 chat := seedWaitingChat(t, db, orgID, user, model, title)
175 now := time.Now()
176 chat, err := db.UpdateChatStatus(ctx, database.UpdateChatStatusParams{
177 ID: chat.ID,
178 Status: database.ChatStatusRunning,
179 WorkerID: uuid.NullUUID{UUID: workerID, Valid: true},
180 StartedAt: sql.NullTime{Time: now, Valid: true},
181 HeartbeatAt: sql.NullTime{Time: now, Valid: true},
182 })
183 require.NoError(t, err)
184 return chat
185}
186
187func setOpenAIProviderBaseURL(
188 ctx context.Context,

Calls 3

seedWaitingChatFunction · 0.85
HelperMethod · 0.65
UpdateChatStatusMethod · 0.65

Tested by

no test coverage detected