-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Updates search_deployment resource with new SDK (#1853)
* remove NonEmptyToPtr * remove NonEmptyToPtr * rename test helper functions * migration test config for search_deployment test group * migration test * fix CheckDestroy for mig tests * fix checkExists * add "updated" to fix flaky test as sometimes created time differs in a second
- Loading branch information
Showing
8 changed files
with
87 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
internal/service/searchdeployment/resource_search_deployment_migration_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package searchdeployment_test | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-testing/helper/acctest" | ||
"github.com/hashicorp/terraform-plugin-testing/helper/resource" | ||
"github.com/hashicorp/terraform-plugin-testing/plancheck" | ||
"github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/acc" | ||
"github.com/mongodb/terraform-provider-mongodbatlas/internal/testutil/mig" | ||
) | ||
|
||
func TestAccMigrationSearchDeployment_basic(t *testing.T) { | ||
var ( | ||
resourceName = "mongodbatlas_search_deployment.test" | ||
orgID = os.Getenv("MONGODB_ATLAS_ORG_ID") | ||
projectName = acctest.RandomWithPrefix("test-acc-search-dep") | ||
clusterName = acctest.RandomWithPrefix("test-acc-search-dep") | ||
instanceSize = "S30_HIGHCPU_NVME" | ||
searchNodeCount = 3 | ||
) | ||
mig.SkipIfVersionBelow(t, "1.13.0") | ||
resource.ParallelTest(t, resource.TestCase{ | ||
PreCheck: func() { mig.PreCheckBasic(t) }, | ||
CheckDestroy: checkDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
ExternalProviders: mig.ExternalProviders(), | ||
Config: configBasic(orgID, projectName, clusterName, instanceSize, searchNodeCount), | ||
Check: resource.ComposeTestCheckFunc(searchNodeChecks(resourceName, clusterName, instanceSize, searchNodeCount)...), | ||
}, | ||
{ | ||
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories, | ||
Config: configBasic(orgID, projectName, clusterName, instanceSize, searchNodeCount), | ||
ConfigPlanChecks: resource.ConfigPlanChecks{ | ||
PreApply: []plancheck.PlanCheck{ | ||
plancheck.ExpectEmptyPlan(), | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters