Skip to content

Commit 88ad267

Browse files
committed
add t.Parallel() everywhere
1 parent 5fa9117 commit 88ad267

16 files changed

+21
-2
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ linters:
1818
- makezero
1919
- misspell
2020
- nilerr
21+
- paralleltest
2122
- predeclared
2223
- staticcheck
2324
- unconvert

integration/integration_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
// - Runs the `main.tf` specified in the given test directory against the Coder deployment
2323
// - Asserts the state of the deployment via `codersdk`.
2424
func TestIntegration(t *testing.T) {
25+
t.Parallel()
2526
if os.Getenv("TF_ACC") == "1" {
2627
t.Skip("Skipping integration tests during tf acceptance tests")
2728
}

internal/provider/group_data_source_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
)
1717

1818
func TestAccGroupDataSource(t *testing.T) {
19+
t.Parallel()
1920
if os.Getenv("TF_ACC") == "" {
2021
t.Skip("Acceptance tests are disabled.")
2122
}

internal/provider/group_resource_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
)
1717

1818
func TestAccGroupResource(t *testing.T) {
19+
t.Parallel()
1920
if os.Getenv("TF_ACC") == "" {
2021
t.Skip("Acceptance tests are disabled.")
2122
}
@@ -133,6 +134,7 @@ func TestAccGroupResource(t *testing.T) {
133134
}
134135

135136
func TestAccGroupResourceAGPL(t *testing.T) {
137+
t.Parallel()
136138
if os.Getenv("TF_ACC") == "" {
137139
t.Skip("Acceptance tests are disabled.")
138140
}

internal/provider/license_resource_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
)
1414

1515
func TestAccLicenseResource(t *testing.T) {
16+
t.Parallel()
1617
if os.Getenv("TF_ACC") == "" {
1718
t.Skip("Acceptance tests are disabled.")
1819
}

internal/provider/organization_data_source_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
)
1717

1818
func TestAccOrganizationDataSource(t *testing.T) {
19+
t.Parallel()
1920
if os.Getenv("TF_ACC") == "" {
2021
t.Skip("Acceptance tests are disabled.")
2122
}

internal/provider/organization_resource_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
)
2020

2121
func TestAccOrganizationResource(t *testing.T) {
22+
t.Parallel()
2223
if os.Getenv("TF_ACC") == "" {
2324
t.Skip("Acceptance tests are disabled.")
2425
}

internal/provider/organization_sync_settings_resource_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
)
1919

2020
func TestAccOrganizationSyncSettingsResource(t *testing.T) {
21+
t.Parallel()
2122
if os.Getenv("TF_ACC") == "" {
2223
t.Skip("Acceptance tests are disabled.")
2324
}

internal/provider/provider_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var testAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServe
1616
}
1717

1818
func testAccPreCheck(t *testing.T) {
19+
t.Parallel()
1920
// You can add code here to run prior to any test case execution, for example assertions
2021
// about the appropriate environment variables being set are common to see in a pre-check
2122
// function.

internal/provider/provisioner_key_resource_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
)
1919

2020
func TestAccProvisionerKeyResource(t *testing.T) {
21+
t.Parallel()
2122
if os.Getenv("TF_ACC") == "" {
2223
t.Skip("Acceptance tests are disabled.")
2324
}

internal/provider/template_data_source_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
)
2121

2222
func TestAccTemplateDataSource(t *testing.T) {
23+
t.Parallel()
2324
if os.Getenv("TF_ACC") == "" {
2425
t.Skip("Acceptance tests are disabled.")
2526
}

internal/provider/template_resource_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
)
2424

2525
func TestAccTemplateResource(t *testing.T) {
26+
t.Parallel()
2627
if os.Getenv("TF_ACC") == "" {
2728
t.Skip("Acceptance tests are disabled.")
2829
}
@@ -637,6 +638,7 @@ func TestAccTemplateResource(t *testing.T) {
637638
}
638639

639640
func TestAccTemplateResourceEnterprise(t *testing.T) {
641+
t.Parallel()
640642
if os.Getenv("TF_ACC") == "" {
641643
t.Skip("Acceptance tests are disabled.")
642644
}
@@ -782,6 +784,7 @@ func TestAccTemplateResourceEnterprise(t *testing.T) {
782784
}
783785

784786
func TestAccTemplateResourceAGPL(t *testing.T) {
787+
t.Parallel()
785788
if os.Getenv("TF_ACC") == "" {
786789
t.Skip("Acceptance tests are disabled.")
787790
}
@@ -875,6 +878,7 @@ func TestAccTemplateResourceAGPL(t *testing.T) {
875878
}
876879

877880
func TestAccTemplateResourceVariables(t *testing.T) {
881+
t.Parallel()
878882
cfg := `
879883
provider coderd {
880884
url = %q
@@ -1137,6 +1141,7 @@ func testAccCheckNumTemplateVersions(ctx context.Context, client *codersdk.Clien
11371141
}
11381142

11391143
func TestReconcileVersionIDs(t *testing.T) {
1144+
t.Parallel()
11401145
aUUID := uuid.New()
11411146
bUUID := uuid.New()
11421147
cases := []struct {

internal/provider/user_data_source_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
)
1717

1818
func TestAccUserDataSource(t *testing.T) {
19+
t.Parallel()
1920
if os.Getenv("TF_ACC") == "" {
2021
t.Skip("Acceptance tests are disabled.")
2122
}

internal/provider/user_resource_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
)
1515

1616
func TestAccUserResource(t *testing.T) {
17+
t.Parallel()
1718
if os.Getenv("TF_ACC") == "" {
1819
t.Skip("Acceptance tests are disabled.")
1920
}

internal/provider/uuid_internal_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ func TestUUIDTypeValueFromTerraform(t *testing.T) {
5050
for _, test := range tests {
5151
test := test
5252
t.Run(test.name, func(t *testing.T) {
53-
t.Parallel()
5453
ctx := context.Background()
5554

5655
actual, err := uuidType.ValueFromTerraform(UUIDType, ctx, test.input)
@@ -85,7 +84,6 @@ func TestUUIDToStringValue(t *testing.T) {
8584
for name, test := range tests {
8685
name, test := name, test
8786
t.Run(name, func(t *testing.T) {
88-
t.Parallel()
8987
ctx := context.Background()
9088

9189
s, _ := test.uuid.ToStringValue(ctx)

internal/provider/workspace_proxy_resource_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
)
1616

1717
func TestAccWorkspaceProxyResource(t *testing.T) {
18+
t.Parallel()
1819
if os.Getenv("TF_ACC") == "" {
1920
t.Skip("Acceptance tests are disabled.")
2021
}
@@ -56,6 +57,7 @@ func TestAccWorkspaceProxyResource(t *testing.T) {
5657
}
5758

5859
func TestAccWorkspaceProxyResourceAGPL(t *testing.T) {
60+
t.Parallel()
5961
if os.Getenv("TF_ACC") == "" {
6062
t.Skip("Acceptance tests are disabled.")
6163
}

0 commit comments

Comments
 (0)