@@ -3,26 +3,21 @@ package test
33
44import (
55 "fmt"
6- "strings"
76
87 "testing"
98
10- "github.com/gruntwork-io/terratest/modules/random"
119 "github.com/stretchr/testify/assert"
1210 "github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
1311)
1412
1513func testPlanICDVersions (t * testing.T , version string ) {
1614 t .Parallel ()
1715
18- prefix := fmt .Sprintf ("mongo-%s" , strings .ToLower (random .UniqueId ()))
19- options := testhelper .TestOptionsDefault (& testhelper.TestOptions {
16+ options := testhelper .TestOptionsDefaultWithVars (& testhelper.TestOptions {
2017 Testing : t ,
2118 TerraformDir : "examples/basic" ,
2219 TerraformVars : map [string ]interface {}{
2320 "mongodb_version" : version ,
24- "prefix" : prefix ,
25- "region" : fmt .Sprint (permanentResources ["mongodbRegion" ]),
2621 },
2722 CloudInfoService : sharedInfoSvc ,
2823 })
@@ -43,15 +38,15 @@ func TestPlanICDVersions(t *testing.T) {
4338
4439func TestRunRestoredDBExample (t * testing.T ) {
4540 t .Parallel ()
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" ,
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 ,
5048 TerraformVars : map [string ]interface {}{
5149 "existing_database_crn" : permanentResources ["mongodbCrn" ],
52- "prefix" : prefix ,
53- "region" : fmt .Sprint (permanentResources ["mongodbRegion" ]),
54- "resource_group" : resourceGroup ,
5550 },
5651 CloudInfoService : sharedInfoSvc ,
5752 })
0 commit comments