Skip to content

Commit deaabec

Browse files
committed
re-add instance-level test with the new token
1 parent 8a3edf8 commit deaabec

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

internal/provider/resource_gitlab_runner_test.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,40 @@ func TestAccGitlabRunner_basic(t *testing.T) {
6363
})
6464
}
6565

66+
func TestAccGitlabRunner_instance(t *testing.T) {
67+
testAccCheck(t)
68+
69+
// This pulls from the gitlab.rb file, and is set on instance start-up
70+
token := "ACCTEST1234567890123_RUNNER_REG_TOKEN"
71+
72+
resource.Test(t, resource.TestCase{
73+
PreCheck: func() {},
74+
ProviderFactories: providerFactories,
75+
CheckDestroy: testAccCheckRunnerDestroy,
76+
Steps: []resource.TestStep{
77+
{
78+
Config: fmt.Sprintf(`
79+
resource "gitlab_runner" "this" {
80+
registration_token = "%s"
81+
description = "Lorem Ipsum"
82+
}
83+
`, token),
84+
Check: resource.ComposeTestCheckFunc(
85+
resource.TestCheckResourceAttrSet("gitlab_runner.this", "registration_token"),
86+
resource.TestCheckResourceAttrSet("gitlab_runner.this", "authentication_token"),
87+
),
88+
},
89+
{
90+
ResourceName: "gitlab_runner.this",
91+
ImportState: true,
92+
ImportStateVerify: true,
93+
//These need to be ignored since they don't come back in the "get" command
94+
ImportStateVerifyIgnore: []string{"authentication_token", "registration_token"},
95+
},
96+
},
97+
})
98+
}
99+
66100
func TestAccGitlabRunner_comprehensive(t *testing.T) {
67101
testAccCheck(t)
68102

0 commit comments

Comments
 (0)