Skip to content

Commit 9b79103

Browse files
committed
update test
1 parent 616661a commit 9b79103

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

tests/other_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
package test
33

44
import (
5-
"math/rand"
65
"testing"
76

87
"github.com/stretchr/testify/assert"
8+
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/common"
99
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
1010
)
1111

@@ -20,7 +20,7 @@ func setupExampleOptions(t *testing.T, prefix string, dir string) *testhelper.Te
2020
there is a restriction with the Event Notification service, which allows only one Lite plan instance per resource group.
2121
*/
2222
// ResourceGroup: resourceGroup,
23-
Region: validRegions[rand.Intn(len(validRegions))],
23+
Region: validRegions[common.CryptoIntn(len(validRegions))],
2424
})
2525

2626
return options

tests/pr_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ package test
44
import (
55
"encoding/json"
66
"fmt"
7-
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/cloudinfo"
8-
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testaddons"
97
"log"
10-
"math/rand"
118
"os"
129
"testing"
1310

11+
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/cloudinfo"
12+
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testaddons"
13+
1414
"github.com/IBM/go-sdk-core/v5/core"
1515
"github.com/stretchr/testify/assert"
1616
"github.com/stretchr/testify/require"
@@ -54,7 +54,7 @@ func TestMain(m *testing.M) {
5454
func TestFSCloudInSchematics(t *testing.T) {
5555
t.Parallel()
5656

57-
var region = validRegions[rand.Intn(len(validRegions))]
57+
var region = validRegions[common.CryptoIntn(len(validRegions))]
5858

5959
options := testschematic.TestSchematicOptionsDefault(&testschematic.TestSchematicOptions{
6060
Testing: t,
@@ -89,7 +89,7 @@ func TestFSCloudInSchematics(t *testing.T) {
8989
func TestSecurityEnforcedDAInSchematics(t *testing.T) {
9090
t.Parallel()
9191

92-
var region = validRegions[rand.Intn(len(validRegions))]
92+
var region = validRegions[common.CryptoIntn(len(validRegions))]
9393

9494
options := testschematic.TestSchematicOptionsDefault(&testschematic.TestSchematicOptions{
9595
Testing: t,
@@ -172,7 +172,7 @@ func TestRunSecurityEnforcedUpgradeDASolution(t *testing.T) {
172172
Tags: []string{"test-schematic"},
173173
DeleteWorkspaceOnFail: false,
174174
WaitJobCompleteMinutes: 60,
175-
Region: validRegions[rand.Intn(len(validRegions))],
175+
Region: validRegions[common.CryptoIntn(len(validRegions))],
176176
CheckApplyResultForUpgrade: true,
177177
TerraformVersion: terraformVersion,
178178
})
@@ -207,7 +207,7 @@ func TestAddonDefaultConfiguration(t *testing.T) {
207207
"deploy-arch-ibm-event-notifications",
208208
"fully-configurable",
209209
map[string]interface{}{
210-
"region": validRegions[rand.Intn(len(validRegions))],
210+
"region": validRegions[common.CryptoIntn(len(validRegions))],
211211
"existing_resource_group": resourceGroup,
212212
},
213213
)

0 commit comments

Comments
 (0)