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

Function TestWorker_MarkStale_NoMatchingChats

coderd/x/gitsync/worker_test.go:666–688  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

664}
665
666func TestWorker_MarkStale_NoMatchingChats(t *testing.T) {
667 t.Parallel()
668 ctx := testutil.Context(t, testutil.WaitShort)
669
670 workspaceID := uuid.New()
671
672 ctrl := gomock.NewController(t)
673 store := dbmock.NewMockStore(ctrl)
674
675 store.EXPECT().GetChatsByWorkspaceIDs(gomock.Any(), gomock.Any()).
676 Return(nil, nil)
677
678 mClock := quartz.NewMock(t)
679 logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
680 refresher := newTestRefresher(t, mClock)
681 worker := gitsync.NewWorker(store, refresher, nil, mClock, logger)
682
683 worker.MarkStale(ctx, gitsync.MarkStaleParams{
684 WorkspaceID: workspaceID,
685 Branch: "main",
686 Origin: "https://github.com/x/y",
687 })
688}
689
690func TestWorker_MarkStale_UpsertFails_ContinuesNext(t *testing.T) {
691 t.Parallel()

Callers

nothing calls this directly

Calls 8

EXPECTMethod · 0.95
MarkStaleMethod · 0.95
ContextFunction · 0.92
NewMockStoreFunction · 0.92
NewWorkerFunction · 0.92
newTestRefresherFunction · 0.85
NewMethod · 0.65

Tested by

no test coverage detected