@@ -3,21 +3,26 @@ package test
33
44import (
55 "fmt"
6+ "strings"
67
78 "testing"
89
10+ "github.com/gruntwork-io/terratest/modules/random"
911 "github.com/stretchr/testify/assert"
1012 "github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
1113)
1214
1315func testPlanICDVersions (t * testing.T , version string ) {
1416 t .Parallel ()
1517
16- options := testhelper .TestOptionsDefaultWithVars (& testhelper.TestOptions {
18+ prefix := fmt .Sprintf ("mongo-%s" , strings .ToLower (random .UniqueId ()))
19+ options := testhelper .TestOptionsDefault (& testhelper.TestOptions {
1720 Testing : t ,
1821 TerraformDir : "examples/basic" ,
1922 TerraformVars : map [string ]interface {}{
2023 "mongodb_version" : version ,
24+ "prefix" : prefix ,
25+ "region" : fmt .Sprint (permanentResources ["mongodbRegion" ]),
2126 },
2227 CloudInfoService : sharedInfoSvc ,
2328 })
@@ -38,15 +43,15 @@ func TestPlanICDVersions(t *testing.T) {
3843
3944func TestRunRestoredDBExample (t * testing.T ) {
4045 t .Parallel ()
41-
42- options := testhelper .TestOptionsDefaultWithVars (& testhelper.TestOptions {
43- Testing : t ,
44- TerraformDir : "examples/backup-restore" ,
45- Prefix : "mongo-restored" ,
46- Region : fmt .Sprint (permanentResources ["mongodbRegion" ]),
47- ResourceGroup : resourceGroup ,
46+ prefix := fmt .Sprintf ("mongodb-res-%s" , strings .ToLower (random .UniqueId ()))
47+ options := testhelper .TestOptionsDefault (& testhelper.TestOptions {
48+ Testing : t ,
49+ TerraformDir : "examples/backup-restore" ,
4850 TerraformVars : map [string ]interface {}{
4951 "existing_database_crn" : permanentResources ["mongodbCrn" ],
52+ "prefix" : prefix ,
53+ "region" : fmt .Sprint (permanentResources ["mongodbRegion" ]),
54+ "resource_group" : resourceGroup ,
5055 },
5156 CloudInfoService : sharedInfoSvc ,
5257 })
0 commit comments