Skip to content

Commit d1c39c9

Browse files
authored
Merge pull request #1126 from timofurrer/feature/parallel-tests
Start parallelizing most of the acceptance tests
2 parents 1c819f5 + 158965c commit d1c39c9

File tree

80 files changed

+137
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+137
-129
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"GITLAB_TOKEN": "ACCTEST1234567890123",
55
"GITLAB_BASE_URL": "http://127.0.0.1:8080"
66
},
7-
"go.testFlags": ["-count=1", "-v", "-tags=acceptance"],
7+
"go.testFlags": ["-count=1", "-v", "-tags=acceptance", "-parallel=2"],
88
"go.buildFlags": ["-tags=acceptance"]
99
}

internal/provider/data_source_gitlab_branch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func TestAccDataGitlabBranch_basic(t *testing.T) {
1616
rInt := acctest.RandInt()
1717
project := testAccCreateProject(t)
18-
resource.Test(t, resource.TestCase{
18+
resource.ParallelTest(t, resource.TestCase{
1919
ProviderFactories: providerFactories,
2020
Steps: []resource.TestStep{
2121
{

internal/provider/data_source_gitlab_cluster_agent_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestAccDataSourceGitlabClusterAgent_basic(t *testing.T) {
1717
testProject := testAccCreateProject(t)
1818
testAgent := testAccCreateClusterAgents(t, testProject.ID, 1)[0]
1919

20-
resource.Test(t, resource.TestCase{
20+
resource.ParallelTest(t, resource.TestCase{
2121
ProviderFactories: providerFactories,
2222
Steps: []resource.TestStep{
2323
{

internal/provider/data_source_gitlab_cluster_agents_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func TestAccDataSourceGitlabClusterAgents_basic(t *testing.T) {
1616
testProject := testAccCreateProject(t)
1717
testClusterAgents := testAccCreateClusterAgents(t, testProject.ID, 25)
1818

19-
resource.Test(t, resource.TestCase{
19+
resource.ParallelTest(t, resource.TestCase{
2020
ProviderFactories: providerFactories,
2121
Steps: []resource.TestStep{
2222
{

internal/provider/data_source_gitlab_group_membership_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
func TestAccDataSourceGitlabMembership_basic(t *testing.T) {
1515
rInt := acctest.RandInt()
1616

17-
resource.Test(t, resource.TestCase{
17+
resource.ParallelTest(t, resource.TestCase{
1818
ProviderFactories: providerFactories,
1919
Steps: []resource.TestStep{
2020
// Create the group and one member

internal/provider/data_source_gitlab_group_variable_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
func TestAccDataSourceGitlabGroupVariable_basic(t *testing.T) {
1515
testGroup := testAccCreateGroups(t, 1)[0]
1616

17-
resource.Test(t, resource.TestCase{
17+
resource.ParallelTest(t, resource.TestCase{
1818
ProviderFactories: providerFactories,
1919
Steps: []resource.TestStep{
2020
{

internal/provider/data_source_gitlab_group_variables_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func TestAccDataSourceGitlabGroupVariables_basic(t *testing.T) {
1818
testVariables = append(testVariables, testAccCreateGroupVariable(t, testGroup.ID))
1919
}
2020

21-
resource.Test(t, resource.TestCase{
21+
resource.ParallelTest(t, resource.TestCase{
2222
ProviderFactories: providerFactories,
2323
Steps: []resource.TestStep{
2424
{

internal/provider/data_source_gitlab_instance_variable_test.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,28 @@ import (
77
"fmt"
88
"testing"
99

10+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
1011
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1112
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
1213
)
1314

1415
func TestAccDataSourceGitlabInstanceVariable_basic(t *testing.T) {
15-
resource.Test(t, resource.TestCase{
16+
rInt := acctest.RandInt()
17+
18+
resource.ParallelTest(t, resource.TestCase{
1619
ProviderFactories: providerFactories,
1720
Steps: []resource.TestStep{
1821
{
19-
Config: `
22+
Config: fmt.Sprintf(`
2023
resource "gitlab_instance_variable" "this" {
21-
key = "any_key"
22-
value = "any-value"
24+
key = "any_key_%d"
25+
value = "any-value"
2326
}
2427
2528
data "gitlab_instance_variable" "this" {
2629
key = gitlab_instance_variable.this.key
2730
}
28-
`,
31+
`, rInt),
2932
Check: resource.ComposeTestCheckFunc(
3033
testAccDataSourceGitlabInstanceVariable("gitlab_instance_variable.this", "data.gitlab_instance_variable.this"),
3134
),

internal/provider/data_source_gitlab_project_issue_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
func TestAccDataSourceGitlabProjectIssue_basic(t *testing.T) {
1515
testProject := testAccCreateProject(t)
1616

17-
resource.Test(t, resource.TestCase{
17+
resource.ParallelTest(t, resource.TestCase{
1818
ProviderFactories: providerFactories,
1919
Steps: []resource.TestStep{
2020
{

internal/provider/data_source_gitlab_project_issues_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func TestAccDataSourceGitlabProjectIssues_basic(t *testing.T) {
1414
testProject := testAccCreateProject(t)
1515
testIssues := testAccCreateProjectIssues(t, testProject.ID, 25)
1616

17-
resource.Test(t, resource.TestCase{
17+
resource.ParallelTest(t, resource.TestCase{
1818
ProviderFactories: providerFactories,
1919
Steps: []resource.TestStep{
2020
{

0 commit comments

Comments
 (0)