Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaa3dbcd

Browse files
authored
chore: addt.Parallel() to speed up tests (#184)
This makes the test suite run in under a minute, compared to severalminutes per run before.
1 parentc440681 commitaa3dbcd

17 files changed

+36
-7
lines changed

‎.golangci.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@ linters:
1818
-makezero
1919
-misspell
2020
-nilerr
21+
-paralleltest
2122
-predeclared
2223
-staticcheck
2324
-unconvert
2425
-unparam
2526
-unused
2627
-usetesting
28+
29+
linters-settings:
30+
paralleltest:
31+
# Terraform acceptance subtests all share a Coder instance, and cannot run
32+
# in parallel.
33+
ignore-missing-subtests:true

‎Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ fmt:
44
go fmt ./...
55
terraform fmt -recursive
66

7-
vet:
8-
go vet ./...
7+
lint:
8+
golangci-lint run ./...
99

1010
gen:
1111
go generate ./...

‎integration/integration_test.go‎

Lines changed: 3 additions & 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
funcTestIntegration(t*testing.T) {
25+
t.Parallel()
2526
ifos.Getenv("TF_ACC")=="1" {
2627
t.Skip("Skipping integration tests during tf acceptance tests")
2728
}
@@ -145,6 +146,8 @@ func TestIntegration(t *testing.T) {
145146
},
146147
} {
147148
t.Run(tt.name,func(t*testing.T) {
149+
t.Parallel()
150+
148151
client:=StartCoder(ctx,t,tt.name,true)
149152
wd,err:=os.Getwd()
150153
require.NoError(t,err)

‎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
funcTestAccGroupDataSource(t*testing.T) {
19+
t.Parallel()
1920
ifos.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
funcTestAccGroupResource(t*testing.T) {
19+
t.Parallel()
1920
ifos.Getenv("TF_ACC")=="" {
2021
t.Skip("Acceptance tests are disabled.")
2122
}
@@ -133,6 +134,7 @@ func TestAccGroupResource(t *testing.T) {
133134
}
134135

135136
funcTestAccGroupResourceAGPL(t*testing.T) {
137+
t.Parallel()
136138
ifos.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
funcTestAccLicenseResource(t*testing.T) {
16+
t.Parallel()
1617
ifos.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
funcTestAccOrganizationDataSource(t*testing.T) {
19+
t.Parallel()
1920
ifos.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
funcTestAccOrganizationResource(t*testing.T) {
22+
t.Parallel()
2223
ifos.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
funcTestAccOrganizationSyncSettingsResource(t*testing.T) {
21+
t.Parallel()
2122
ifos.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
functestAccPreCheck(t*testing.T) {
19+
t.Helper()
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.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp