Skip to content

Commit 8c1fab2

Browse files
committed
idk how this wound up here
1 parent 2f5a403 commit 8c1fab2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

coderd/agentapi/stats_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ func TestUpdateStates(t *testing.T) {
316316
nextAutostart := now.Add(30 * time.Minute).UTC() // always sent to DB as UTC
317317

318318
var (
319-
db = dbmock.NewMockStore(gomock.NewController(t))
320-
ps = pubsub.NewInMemory()
319+
dbM = dbmock.NewMockStore(gomock.NewController(t))
320+
ps = pubsub.NewInMemory()
321321

322322
templateScheduleStore = schedule.MockTemplateScheduleStore{
323323
GetFn: func(context.Context, database.Store, uuid.UUID) (schedule.TemplateScheduleOptions, error) {
@@ -349,7 +349,7 @@ func TestUpdateStates(t *testing.T) {
349349
AgentFn: func(context.Context) (database.WorkspaceAgent, error) {
350350
return agent, nil
351351
},
352-
Database: db,
352+
Database: dbM,
353353
Pubsub: ps,
354354
StatsBatcher: batcher,
355355
TemplateScheduleStore: templateScheduleStorePtr(templateScheduleStore),
@@ -370,26 +370,26 @@ func TestUpdateStates(t *testing.T) {
370370
}
371371

372372
// Workspace gets fetched.
373-
db.EXPECT().GetWorkspaceByAgentID(gomock.Any(), agent.ID).Return(database.GetWorkspaceByAgentIDRow{
373+
dbM.EXPECT().GetWorkspaceByAgentID(gomock.Any(), agent.ID).Return(database.GetWorkspaceByAgentIDRow{
374374
Workspace: workspace,
375375
TemplateName: template.Name,
376376
}, nil)
377377

378378
// We expect an activity bump because ConnectionCount > 0. However, the
379379
// next autostart time will be set on the bump.
380-
db.EXPECT().ActivityBumpWorkspace(gomock.Any(), database.ActivityBumpWorkspaceParams{
380+
dbM.EXPECT().ActivityBumpWorkspace(gomock.Any(), database.ActivityBumpWorkspaceParams{
381381
WorkspaceID: workspace.ID,
382382
NextAutostart: nextAutostart,
383383
}).Return(nil)
384384

385385
// Workspace last used at gets bumped.
386-
db.EXPECT().UpdateWorkspaceLastUsedAt(gomock.Any(), database.UpdateWorkspaceLastUsedAtParams{
386+
dbM.EXPECT().UpdateWorkspaceLastUsedAt(gomock.Any(), database.UpdateWorkspaceLastUsedAtParams{
387387
ID: workspace.ID,
388388
LastUsedAt: now,
389389
}).Return(nil)
390390

391391
// User gets fetched to hit the UpdateAgentMetricsFn.
392-
db.EXPECT().GetUserByID(gomock.Any(), user.ID).Return(user, nil)
392+
dbM.EXPECT().GetUserByID(gomock.Any(), user.ID).Return(user, nil)
393393

394394
resp, err := api.UpdateStats(context.Background(), req)
395395
require.NoError(t, err)

0 commit comments

Comments
 (0)