Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions tests/other_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ package test

import (
"fmt"
"strings"

"testing"

"github.com/gruntwork-io/terratest/modules/random"
"github.com/stretchr/testify/assert"
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
)

func testPlanICDVersions(t *testing.T, version string) {
t.Parallel()

options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{
prefix := fmt.Sprintf("mongo-%s", strings.ToLower(random.UniqueId()))
options := testhelper.TestOptionsDefault(&testhelper.TestOptions{
Testing: t,
TerraformDir: "examples/basic",
TerraformVars: map[string]interface{}{
"mongodb_version": version,
"prefix": prefix,
"region": fmt.Sprint(permanentResources["mongodbRegion"]),
},
CloudInfoService: sharedInfoSvc,
})
Expand All @@ -38,15 +43,15 @@ func TestPlanICDVersions(t *testing.T) {

func TestRunRestoredDBExample(t *testing.T) {
t.Parallel()

options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{
Testing: t,
TerraformDir: "examples/backup-restore",
Prefix: "mongo-restored",
Region: fmt.Sprint(permanentResources["mongodbRegion"]),
ResourceGroup: resourceGroup,
prefix := fmt.Sprintf("mongodb-res-%s", strings.ToLower(random.UniqueId()))
options := testhelper.TestOptionsDefault(&testhelper.TestOptions{
Testing: t,
TerraformDir: "examples/backup-restore",
TerraformVars: map[string]interface{}{
"existing_database_crn": permanentResources["mongodbCrn"],
"prefix": prefix,
"region": fmt.Sprint(permanentResources["mongodbRegion"]),
"resource_group": resourceGroup,
},
CloudInfoService: sharedInfoSvc,
})
Expand Down