Skip to content

Commit 0b685a9

Browse files
committed
Improve tests
1 parent ab8792f commit 0b685a9

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

coderd/workspacebuilds_test.go

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,8 +1183,9 @@ func TestPostWorkspaceBuild(t *testing.T) {
11831183
})
11841184
}
11851185

1186-
//nolint:paralleltest
11871186
func TestWorkspaceBuildTimings(t *testing.T) {
1187+
t.Parallel()
1188+
11881189
// Setup the test environment with a template and version
11891190
db, pubsub := dbtestutil.NewDB(t)
11901191
client := coderdtest.New(t, &coderdtest.Options{
@@ -1237,8 +1238,9 @@ func TestWorkspaceBuildTimings(t *testing.T) {
12371238
})
12381239
}
12391240

1240-
//nolint:paralleltest
12411241
t.Run("NonExistentBuild", func(t *testing.T) {
1242+
t.Parallel()
1243+
12421244
// Given: a non-existent build
12431245
buildID := uuid.New()
12441246

@@ -1252,8 +1254,9 @@ func TestWorkspaceBuildTimings(t *testing.T) {
12521254
require.Contains(t, err.Error(), "not found")
12531255
})
12541256

1255-
//nolint:paralleltest
12561257
t.Run("EmptyTimings", func(t *testing.T) {
1258+
t.Parallel()
1259+
12571260
// Given: a build with no timings
12581261
build := makeBuild()
12591262

@@ -1268,8 +1271,9 @@ func TestWorkspaceBuildTimings(t *testing.T) {
12681271
require.Empty(t, res.AgentScriptTimings)
12691272
})
12701273

1271-
//nolint:paralleltest
12721274
t.Run("ProvisionerTimings", func(t *testing.T) {
1275+
t.Parallel()
1276+
12731277
// Given: a build with provisioner timings
12741278
build := makeBuild()
12751279
provisionerTimings := dbgen.ProvisionerJobTimings(t, db, build, 5)
@@ -1295,8 +1299,9 @@ func TestWorkspaceBuildTimings(t *testing.T) {
12951299
}
12961300
})
12971301

1298-
//nolint:paralleltest
12991302
t.Run("AgentScriptTimings", func(t *testing.T) {
1303+
t.Parallel()
1304+
13001305
// Given: a build with agent script timings
13011306
build := makeBuild()
13021307
resource := dbgen.WorkspaceResource(t, db, database.WorkspaceResource{
@@ -1331,8 +1336,9 @@ func TestWorkspaceBuildTimings(t *testing.T) {
13311336
}
13321337
})
13331338

1334-
//nolint:paralleltest
13351339
t.Run("NoAgentScripts", func(t *testing.T) {
1340+
t.Parallel()
1341+
13361342
// Given: a build with no agent scripts
13371343
build := makeBuild()
13381344
resource := dbgen.WorkspaceResource(t, db, database.WorkspaceResource{
@@ -1353,8 +1359,9 @@ func TestWorkspaceBuildTimings(t *testing.T) {
13531359
})
13541360

13551361
// Some workspaces might not have agents. It is improbable, but possible.
1356-
//nolint:paralleltest
13571362
t.Run("NoAgents", func(t *testing.T) {
1363+
t.Parallel()
1364+
13581365
// Given: a build with no agents
13591366
build := makeBuild()
13601367
dbgen.WorkspaceResource(t, db, database.WorkspaceResource{
@@ -1369,10 +1376,12 @@ func TestWorkspaceBuildTimings(t *testing.T) {
13691376

13701377
// Then: return a response with empty agent script timings
13711378
require.Empty(t, res.AgentScriptTimings)
1379+
require.Empty(t, res.AgentConnectionTimings)
13721380
})
13731381

1374-
//nolint:paralleltest
13751382
t.Run("AgentConnectionTimings", func(t *testing.T) {
1383+
t.Parallel()
1384+
13761385
// Given: a build with multiple agents
13771386
build := makeBuild()
13781387
resource := dbgen.WorkspaceResource(t, db, database.WorkspaceResource{

0 commit comments

Comments
 (0)