Skip to content

Commit 40db6f2

Browse files
committed
Merge branch 'main' of github.com:Moon1706/terraform-provider-gitlab into main
2 parents aabb89b + 14c433e commit 40db6f2

File tree

83 files changed

+317
-188
lines changed

Some content is hidden

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

83 files changed

+317
-188
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
}

docs/resources/project.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ The `gitlab_project` resource allows to manage the lifecycle of a project.
2020

2121
A project can either be created in a group or user namespace.
2222

23-
-> **Default Branch Protection Workaround** Projects are created with default branch protection.
24-
Since this default branch protection is not currently managed via Terraform, to workaround this limitation,
23+
-> **Default Branch Protection Workaround** Projects are created with default branch protection.
24+
Since this default branch protection is not currently managed via Terraform, to workaround this limitation,
2525
you can remove the default branch protection via the API and create your desired Terraform managed branch protection.
26-
In the `gitlab_project` resource, define a `local-exec` provisioner which invokes
27-
the `/projects/:id/protected_branches/:name` API via curl to delete the branch protection on the default
26+
In the `gitlab_project` resource, define a `local-exec` provisioner which invokes
27+
the `/projects/:id/protected_branches/:name` API via curl to delete the branch protection on the default
2828
branch using a `DELETE` request. Then define the desired branch protection using the `gitlab_branch_protection` resource.
2929

3030
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ce/api/projects.html)

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
{

0 commit comments

Comments
 (0)