@@ -69,11 +69,9 @@ func TestUpdateLifecycle(t *testing.T) {
69
69
AgentFn : func (ctx context.Context ) (database.WorkspaceAgent , error ) {
70
70
return agentCreated , nil
71
71
},
72
- WorkspaceIDFn : func (ctx context.Context , agent * database.WorkspaceAgent ) (uuid.UUID , error ) {
73
- return workspaceID , nil
74
- },
75
- Database : dbM ,
76
- Log : slogtest .Make (t , nil ),
72
+ WorkspaceID : workspaceID ,
73
+ Database : dbM ,
74
+ Log : slogtest .Make (t , nil ),
77
75
PublishWorkspaceUpdateFn : func (ctx context.Context , agent * database.WorkspaceAgent ) error {
78
76
publishCalled = true
79
77
return nil
@@ -111,11 +109,9 @@ func TestUpdateLifecycle(t *testing.T) {
111
109
AgentFn : func (ctx context.Context ) (database.WorkspaceAgent , error ) {
112
110
return agentStarting , nil
113
111
},
114
- WorkspaceIDFn : func (ctx context.Context , agent * database.WorkspaceAgent ) (uuid.UUID , error ) {
115
- return workspaceID , nil
116
- },
117
- Database : dbM ,
118
- Log : slogtest .Make (t , nil ),
112
+ WorkspaceID : workspaceID ,
113
+ Database : dbM ,
114
+ Log : slogtest .Make (t , nil ),
119
115
// Test that nil publish fn works.
120
116
PublishWorkspaceUpdateFn : nil ,
121
117
}
@@ -156,11 +152,9 @@ func TestUpdateLifecycle(t *testing.T) {
156
152
AgentFn : func (ctx context.Context ) (database.WorkspaceAgent , error ) {
157
153
return agentCreated , nil
158
154
},
159
- WorkspaceIDFn : func (ctx context.Context , agent * database.WorkspaceAgent ) (uuid.UUID , error ) {
160
- return workspaceID , nil
161
- },
162
- Database : dbM ,
163
- Log : slogtest .Make (t , nil ),
155
+ WorkspaceID : workspaceID ,
156
+ Database : dbM ,
157
+ Log : slogtest .Make (t , nil ),
164
158
PublishWorkspaceUpdateFn : func (ctx context.Context , agent * database.WorkspaceAgent ) error {
165
159
publishCalled = true
166
160
return nil
@@ -204,9 +198,7 @@ func TestUpdateLifecycle(t *testing.T) {
204
198
AgentFn : func (ctx context.Context ) (database.WorkspaceAgent , error ) {
205
199
return agentCreated , nil
206
200
},
207
- WorkspaceIDFn : func (ctx context.Context , agent * database.WorkspaceAgent ) (uuid.UUID , error ) {
208
- return workspaceID , nil
209
- },
201
+ WorkspaceID : workspaceID ,
210
202
Database : dbM ,
211
203
Log : slogtest .Make (t , nil ),
212
204
PublishWorkspaceUpdateFn : nil ,
@@ -239,11 +231,9 @@ func TestUpdateLifecycle(t *testing.T) {
239
231
AgentFn : func (ctx context.Context ) (database.WorkspaceAgent , error ) {
240
232
return agent , nil
241
233
},
242
- WorkspaceIDFn : func (ctx context.Context , agent * database.WorkspaceAgent ) (uuid.UUID , error ) {
243
- return workspaceID , nil
244
- },
245
- Database : dbM ,
246
- Log : slogtest .Make (t , nil ),
234
+ WorkspaceID : workspaceID ,
235
+ Database : dbM ,
236
+ Log : slogtest .Make (t , nil ),
247
237
PublishWorkspaceUpdateFn : func (ctx context.Context , agent * database.WorkspaceAgent ) error {
248
238
atomic .AddInt64 (& publishCalled , 1 )
249
239
return nil
@@ -314,11 +304,9 @@ func TestUpdateLifecycle(t *testing.T) {
314
304
AgentFn : func (ctx context.Context ) (database.WorkspaceAgent , error ) {
315
305
return agentCreated , nil
316
306
},
317
- WorkspaceIDFn : func (ctx context.Context , agent * database.WorkspaceAgent ) (uuid.UUID , error ) {
318
- return workspaceID , nil
319
- },
320
- Database : dbM ,
321
- Log : slogtest .Make (t , nil ),
307
+ WorkspaceID : workspaceID ,
308
+ Database : dbM ,
309
+ Log : slogtest .Make (t , nil ),
322
310
PublishWorkspaceUpdateFn : func (ctx context.Context , agent * database.WorkspaceAgent ) error {
323
311
publishCalled = true
324
312
return nil
@@ -354,11 +342,9 @@ func TestUpdateStartup(t *testing.T) {
354
342
AgentFn : func (ctx context.Context ) (database.WorkspaceAgent , error ) {
355
343
return agent , nil
356
344
},
357
- WorkspaceIDFn : func (ctx context.Context , agent * database.WorkspaceAgent ) (uuid.UUID , error ) {
358
- return workspaceID , nil
359
- },
360
- Database : dbM ,
361
- Log : slogtest .Make (t , nil ),
345
+ WorkspaceID : workspaceID ,
346
+ Database : dbM ,
347
+ Log : slogtest .Make (t , nil ),
362
348
// Not used by UpdateStartup.
363
349
PublishWorkspaceUpdateFn : nil ,
364
350
}
@@ -402,11 +388,9 @@ func TestUpdateStartup(t *testing.T) {
402
388
AgentFn : func (ctx context.Context ) (database.WorkspaceAgent , error ) {
403
389
return agent , nil
404
390
},
405
- WorkspaceIDFn : func (ctx context.Context , agent * database.WorkspaceAgent ) (uuid.UUID , error ) {
406
- return workspaceID , nil
407
- },
408
- Database : dbM ,
409
- Log : slogtest .Make (t , nil ),
391
+ WorkspaceID : workspaceID ,
392
+ Database : dbM ,
393
+ Log : slogtest .Make (t , nil ),
410
394
// Not used by UpdateStartup.
411
395
PublishWorkspaceUpdateFn : nil ,
412
396
}
@@ -435,11 +419,9 @@ func TestUpdateStartup(t *testing.T) {
435
419
AgentFn : func (ctx context.Context ) (database.WorkspaceAgent , error ) {
436
420
return agent , nil
437
421
},
438
- WorkspaceIDFn : func (ctx context.Context , agent * database.WorkspaceAgent ) (uuid.UUID , error ) {
439
- return workspaceID , nil
440
- },
441
- Database : dbM ,
442
- Log : slogtest .Make (t , nil ),
422
+ WorkspaceID : workspaceID ,
423
+ Database : dbM ,
424
+ Log : slogtest .Make (t , nil ),
443
425
// Not used by UpdateStartup.
444
426
PublishWorkspaceUpdateFn : nil ,
445
427
}
0 commit comments