Skip to content

Commit 17db3b3

Browse files
authored
test: Project tags. Ensure error messages from server are informative (#2316)
1 parent e8a47ae commit 17db3b3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

internal/service/project/resource_project_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,7 @@ func TestAccProject_withTags(t *testing.T) {
10011001
tagsOnlyIgnored = map[string]string{
10021002
"Name": nameUpdated,
10031003
}
1004+
longTagValue = strings.Repeat("a", 257)
10041005
)
10051006

10061007
resource.ParallelTest(t, resource.TestCase{
@@ -1017,6 +1018,14 @@ func TestAccProject_withTags(t *testing.T) {
10171018
resource.TestCheckResourceAttr(dataSourceNameByID, "tags.#", "0"),
10181019
),
10191020
},
1021+
{
1022+
Config: configWithTags(orgID, projectName, map[string]string{"invalid-tag-value": "test/test"}),
1023+
ExpectError: regexp.MustCompile(`contains invalid characters\W+Allowable characters include`),
1024+
},
1025+
{
1026+
Config: configWithTags(orgID, projectName, map[string]string{"long-tag": longTagValue}),
1027+
ExpectError: regexp.MustCompile(`exceeded the maximum allowed length of \d+ characters`),
1028+
},
10201029
{
10211030
Config: configWithTags(orgID, projectName, tagsEmpty),
10221031
Check: resource.ComposeTestCheckFunc(

0 commit comments

Comments
 (0)