@@ -316,8 +316,8 @@ func TestUpdateStates(t *testing.T) {
316
316
nextAutostart := now .Add (30 * time .Minute ).UTC () // always sent to DB as UTC
317
317
318
318
var (
319
- db = dbmock .NewMockStore (gomock .NewController (t ))
320
- ps = pubsub .NewInMemory ()
319
+ dbM = dbmock .NewMockStore (gomock .NewController (t ))
320
+ ps = pubsub .NewInMemory ()
321
321
322
322
templateScheduleStore = schedule.MockTemplateScheduleStore {
323
323
GetFn : func (context.Context , database.Store , uuid.UUID ) (schedule.TemplateScheduleOptions , error ) {
@@ -349,7 +349,7 @@ func TestUpdateStates(t *testing.T) {
349
349
AgentFn : func (context.Context ) (database.WorkspaceAgent , error ) {
350
350
return agent , nil
351
351
},
352
- Database : db ,
352
+ Database : dbM ,
353
353
Pubsub : ps ,
354
354
StatsBatcher : batcher ,
355
355
TemplateScheduleStore : templateScheduleStorePtr (templateScheduleStore ),
@@ -370,26 +370,26 @@ func TestUpdateStates(t *testing.T) {
370
370
}
371
371
372
372
// 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 {
374
374
Workspace : workspace ,
375
375
TemplateName : template .Name ,
376
376
}, nil )
377
377
378
378
// We expect an activity bump because ConnectionCount > 0. However, the
379
379
// 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 {
381
381
WorkspaceID : workspace .ID ,
382
382
NextAutostart : nextAutostart ,
383
383
}).Return (nil )
384
384
385
385
// Workspace last used at gets bumped.
386
- db .EXPECT ().UpdateWorkspaceLastUsedAt (gomock .Any (), database.UpdateWorkspaceLastUsedAtParams {
386
+ dbM .EXPECT ().UpdateWorkspaceLastUsedAt (gomock .Any (), database.UpdateWorkspaceLastUsedAtParams {
387
387
ID : workspace .ID ,
388
388
LastUsedAt : now ,
389
389
}).Return (nil )
390
390
391
391
// 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 )
393
393
394
394
resp , err := api .UpdateStats (context .Background (), req )
395
395
require .NoError (t , err )
0 commit comments