@@ -15,11 +15,6 @@ import (
1515)
1616
1717func TestAccGithubRepositoryPages (t * testing.T ) {
18- baseRepoVisibility := "public"
19- if testAccConf .authMode == enterprise {
20- baseRepoVisibility = "private"
21- }
22-
2318 t .Run ("creates_pages_with_legacy_build_type" , func (t * testing.T ) {
2419 randomID := acctest .RandString (5 )
2520 repoName := fmt .Sprintf ("%spages-%s" , testResourcePrefix , randomID )
@@ -40,7 +35,7 @@ func TestAccGithubRepositoryPages(t *testing.T) {
4035 path = "/"
4136 }
4237 }
43- ` , repoName , baseRepoVisibility )
38+ ` , repoName , testAccConf . testRepositoryVisibility )
4439
4540 resource .Test (t , resource.TestCase {
4641 PreCheck : func () { skipUnauthenticated (t ) },
@@ -75,7 +70,7 @@ func TestAccGithubRepositoryPages(t *testing.T) {
7570 repository = github_repository.test.name
7671 build_type = "workflow"
7772 }
78- ` , repoName , baseRepoVisibility )
73+ ` , repoName , testAccConf . testRepositoryVisibility )
7974
8075 resource .Test (t , resource.TestCase {
8176 PreCheck : func () { skipUnauthenticated (t ) },
@@ -121,13 +116,13 @@ source {
121116 ProviderFactories : providerFactories ,
122117 Steps : []resource.TestStep {
123118 {
124- Config : fmt .Sprintf (config , repoName , baseRepoVisibility , "legacy" , sourceConfig ),
119+ Config : fmt .Sprintf (config , repoName , testAccConf . testRepositoryVisibility , "legacy" , sourceConfig ),
125120 ConfigStateChecks : []statecheck.StateCheck {
126121 statecheck .ExpectKnownValue ("github_repository_pages.test" , tfjsonpath .New ("build_type" ), knownvalue .StringExact ("legacy" )),
127122 },
128123 },
129124 {
130- Config : fmt .Sprintf (config , repoName , baseRepoVisibility , "workflow" , "" ),
125+ Config : fmt .Sprintf (config , repoName , testAccConf . testRepositoryVisibility , "workflow" , "" ),
131126 ConfigStateChecks : []statecheck.StateCheck {
132127 statecheck .ExpectKnownValue ("github_repository_pages.test" , tfjsonpath .New ("build_type" ), knownvalue .StringExact ("workflow" )),
133128 },
@@ -163,7 +158,7 @@ source {
163158 ProviderFactories : providerFactories ,
164159 Steps : []resource.TestStep {
165160 {
166- Config : fmt .Sprintf (config , repoName , baseRepoVisibility ),
161+ Config : fmt .Sprintf (config , repoName , testAccConf . testRepositoryVisibility ),
167162 ConfigStateChecks : []statecheck.StateCheck {
168163 statecheck .ExpectKnownValue ("github_repository_pages.test" , tfjsonpath .New ("public" ), knownvalue .Bool (false )),
169164 },
@@ -203,13 +198,13 @@ source {
203198 ProviderFactories : providerFactories ,
204199 Steps : []resource.TestStep {
205200 {
206- Config : fmt .Sprintf (config , repoName , baseRepoVisibility , true ),
201+ Config : fmt .Sprintf (config , repoName , testAccConf . testRepositoryVisibility , true ),
207202 ConfigStateChecks : []statecheck.StateCheck {
208203 publicValuesDiffer .AddStateValue ("github_repository_pages.test" , tfjsonpath .New ("public" )),
209204 },
210205 },
211206 {
212- Config : fmt .Sprintf (config , repoName , baseRepoVisibility , false ),
207+ Config : fmt .Sprintf (config , repoName , testAccConf . testRepositoryVisibility , false ),
213208 ConfigStateChecks : []statecheck.StateCheck {
214209 publicValuesDiffer .AddStateValue ("github_repository_pages.test" , tfjsonpath .New ("public" )),
215210 },
@@ -234,7 +229,7 @@ source {
234229 build_type = "workflow"
235230 https_enforced = true
236231 }
237- ` , repoName , baseRepoVisibility )
232+ ` , repoName , testAccConf . testRepositoryVisibility )
238233
239234 resource .Test (t , resource.TestCase {
240235 PreCheck : func () { skipUnauthenticated (t ) },
@@ -268,7 +263,7 @@ source {
268263 path = "/"
269264 }
270265 }
271- ` , repoName , baseRepoVisibility )
266+ ` , repoName , testAccConf . testRepositoryVisibility )
272267
273268 resource .Test (t , resource.TestCase {
274269 PreCheck : func () { skipUnauthenticated (t ) },
0 commit comments