@@ -63,6 +63,40 @@ func TestAccGitlabRunner_basic(t *testing.T) {
63
63
})
64
64
}
65
65
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
+
66
100
func TestAccGitlabRunner_comprehensive (t * testing.T ) {
67
101
testAccCheck (t )
68
102
0 commit comments