MCPcopy Index your code
hub / github.com/coder/coder / insertParentWithArchivedChild

Function insertParentWithArchivedChild

coderd/x/chatd/chatd_test.go:1683–1698  ·  view source on GitHub ↗

insertParentWithArchivedChild creates an active parent and an individually-archived child. The returned child reflects its current (archived) state in the DB.

(
	ctx context.Context,
	t *testing.T,
	db database.Store,
	user database.User,
	org database.Organization,
	model database.ChatModelConfig,
)

Source from the content-addressed store, hash-verified

1681// individually-archived child. The returned child reflects its
1682// current (archived) state in the DB.
1683func insertParentWithArchivedChild(
1684 ctx context.Context,
1685 t *testing.T,
1686 db database.Store,
1687 user database.User,
1688 org database.Organization,
1689 model database.ChatModelConfig,
1690) (parent database.Chat, child database.Chat) {
1691 t.Helper()
1692 parent, child = insertParentWithActiveChild(t, db, user, org, model)
1693 _, err := db.ArchiveChatByID(ctx, child.ID)
1694 require.NoError(t, err)
1695 child, err = db.GetChatByID(ctx, child.ID)
1696 require.NoError(t, err)
1697 return parent, child
1698}
1699
1700func TestArchiveChatInterruptsActiveProcessing(t *testing.T) {
1701 t.Parallel()

Callers 1

TestUnarchiveChildChatFunction · 0.85

Calls 4

HelperMethod · 0.65
ArchiveChatByIDMethod · 0.65
GetChatByIDMethod · 0.65

Tested by

no test coverage detected