@@ -1219,7 +1219,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {
1219
1219
1220
1220
// Tests will run in parallel. To avoid conflicts and race conditions on the
1221
1221
// build number, each test will have its own workspace and build.
1222
- makeBuild := func () database.WorkspaceBuild {
1222
+ makeBuild := func (t * testing. T ) database.WorkspaceBuild {
1223
1223
ws := dbgen .Workspace (t , db , database.WorkspaceTable {
1224
1224
OwnerID : user .ID ,
1225
1225
OrganizationID : owner .OrganizationID ,
@@ -1260,7 +1260,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {
1260
1260
t .Parallel ()
1261
1261
1262
1262
// Given: a build with no timings
1263
- build := makeBuild ()
1263
+ build := makeBuild (t )
1264
1264
1265
1265
// When: fetching timings for the build
1266
1266
ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitLong )
@@ -1277,7 +1277,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {
1277
1277
t .Parallel ()
1278
1278
1279
1279
// Given: a build with provisioner timings
1280
- build := makeBuild ()
1280
+ build := makeBuild (t )
1281
1281
provisionerTimings := dbgen .ProvisionerJobTimings (t , db , build , 5 )
1282
1282
1283
1283
// When: fetching timings for the build
@@ -1305,7 +1305,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {
1305
1305
t .Parallel ()
1306
1306
1307
1307
// Given: a build with agent script timings
1308
- build := makeBuild ()
1308
+ build := makeBuild (t )
1309
1309
resource := dbgen .WorkspaceResource (t , db , database.WorkspaceResource {
1310
1310
JobID : build .JobID ,
1311
1311
})
@@ -1342,7 +1342,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {
1342
1342
t .Parallel ()
1343
1343
1344
1344
// Given: a build with no agent scripts
1345
- build := makeBuild ()
1345
+ build := makeBuild (t )
1346
1346
resource := dbgen .WorkspaceResource (t , db , database.WorkspaceResource {
1347
1347
JobID : build .JobID ,
1348
1348
})
@@ -1365,7 +1365,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {
1365
1365
t .Parallel ()
1366
1366
1367
1367
// Given: a build with no agents
1368
- build := makeBuild ()
1368
+ build := makeBuild (t )
1369
1369
dbgen .WorkspaceResource (t , db , database.WorkspaceResource {
1370
1370
JobID : build .JobID ,
1371
1371
})
@@ -1385,7 +1385,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {
1385
1385
t .Parallel ()
1386
1386
1387
1387
// Given: a build with an agent
1388
- build := makeBuild ()
1388
+ build := makeBuild (t )
1389
1389
resource := dbgen .WorkspaceResource (t , db , database.WorkspaceResource {
1390
1390
JobID : build .JobID ,
1391
1391
})
@@ -1414,7 +1414,7 @@ func TestWorkspaceBuildTimings(t *testing.T) {
1414
1414
t .Parallel ()
1415
1415
1416
1416
// Given: a build with multiple agents
1417
- build := makeBuild ()
1417
+ build := makeBuild (t )
1418
1418
resource := dbgen .WorkspaceResource (t , db , database.WorkspaceResource {
1419
1419
JobID : build .JobID ,
1420
1420
})
0 commit comments