Skip to content

Commit ad479a3

Browse files
committed
fix: replace hardcoded random ID with dynamic generation in repository file tests
1 parent c204c30 commit ad479a3

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

github/resource_github_repository_file_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import (
1212

1313
func TestAccGithubRepositoryFile(t *testing.T) {
1414

15-
randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum)
16-
1715
t.Run("creates and manages files", func(t *testing.T) {
1816

1917
config := fmt.Sprintf(`
@@ -33,7 +31,7 @@ func TestAccGithubRepositoryFile(t *testing.T) {
3331
commit_author = "Terraform User"
3432
commit_email = "[email protected]"
3533
}
36-
`, randomID)
34+
`, acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum))
3735
check := resource.ComposeTestCheckFunc(
3836
resource.TestCheckResourceAttr(
3937
"github_repository_file.test", "content",
@@ -111,7 +109,7 @@ func TestAccGithubRepositoryFile(t *testing.T) {
111109
commit_email = "[email protected]"
112110
}
113111
114-
`, randomID)
112+
`, acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum))
115113

116114
check := resource.ComposeTestCheckFunc(
117115
resource.TestCheckResourceAttr(
@@ -202,7 +200,7 @@ func TestAccGithubRepositoryFile(t *testing.T) {
202200
commit_author = "Terraform User"
203201
commit_email = "[email protected]"
204202
}
205-
`, randomID)
203+
`, acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum))
206204

207205
check := resource.ComposeTestCheckFunc(
208206
resource.TestCheckResourceAttr(
@@ -280,7 +278,7 @@ func TestAccGithubRepositoryFile(t *testing.T) {
280278
commit_email = "[email protected]"
281279
autocreate_branch = false
282280
}
283-
`, randomID)
281+
`, acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum))
284282

285283
check := resource.ComposeTestCheckFunc(
286284
resource.TestCheckResourceAttr(

0 commit comments

Comments
 (0)