Skip to content

Commit f3f2cc0

Browse files
skip resource policy mig test until 1.33.0
1 parent 060e16a commit f3f2cc0

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

internal/service/resourcepolicy/resource_migration_test.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ import (
77
)
88

99
func TestMigResourcePolicy_basic(t *testing.T) {
10-
mig.SkipIfVersionBelow(t, "1.22.0") // this feature was introduced in provider version 1.21.0, plural data source schema was changed in 1.22.0
11-
12-
var description *string
13-
if mig.IsProviderVersionAtLeast("1.32.0") {
14-
description = descriptionPtr
15-
}
16-
17-
mig.CreateAndRunTestNonParallel(t, basicTestCase(t, description))
10+
mig.SkipIfVersionBelow(t, "1.33.0") // this feature was GA (no need of MONGODB_ATLAS_ENABLE_PREVIEW env variable) in 1.33.0
11+
mig.CreateAndRunTestNonParallel(t, basicTestCase(t, descriptionPtr))
1812
}

internal/service/resourcepolicy/resource_test.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,33 +52,31 @@ var (
5252
when {
5353
context.project.ipAccessList.contains(ip("0.0.0.0/0"))
5454
};`
55-
descriptionPtr = conversion.StringPtr("test-description")
55+
description = "test-description"
5656
)
5757

5858
func TestAccResourcePolicy_basic(t *testing.T) {
59-
tc := basicTestCase(t, descriptionPtr)
59+
tc := basicTestCase(t)
6060
resource.Test(t, *tc)
6161
}
6262

63-
func basicTestCase(t *testing.T, description *string) *resource.TestCase {
63+
func basicTestCase(t *testing.T) *resource.TestCase {
6464
t.Helper()
6565
var (
6666
orgID = os.Getenv("MONGODB_ATLAS_ORG_ID")
6767
policyName = "test-policy"
6868
updatedName = "updated-policy"
6969
)
70-
var updatedDescription string
71-
if description != nil {
72-
updatedDescription = fmt.Sprintf("updated-%s", *description)
73-
}
70+
updatedDescription := fmt.Sprintf("updated-%s", description)
71+
7472
return &resource.TestCase{ // Need sequential execution for assertions to be deterministic (plural data source)
7573
PreCheck: func() { acc.PreCheckBasic(t) },
7674
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
7775
CheckDestroy: checkDestroy,
7876
Steps: []resource.TestStep{
7977
{
80-
Config: configBasic(orgID, policyName, description),
81-
Check: checksResourcePolicy(orgID, policyName, description, 1),
78+
Config: configBasic(orgID, policyName, &description),
79+
Check: checksResourcePolicy(orgID, policyName, &description, 1),
8280
},
8381
{
8482
Config: configBasic(orgID, updatedName, nil),

0 commit comments

Comments
 (0)