@@ -14,6 +14,10 @@ import (
1414
1515const defaultExampleTerraformDir = "solutions/e2e"
1616
17+ // Need to use different regions per test to ensure there is no clash in SSH keys as ssh key value has to be unique per VPC region
18+ const region1 = "us-south"
19+ const region2 = "us-east"
20+
1721var sharedInfoSvc * cloudinfo.CloudInfoService
1822
1923func TestMain (m * testing.M ) {
@@ -26,22 +30,26 @@ func TestMain(m *testing.M) {
2630 sshPrivateKey := "<<EOF\n " + rsaKeyPair .PrivateKey + "EOF"
2731 os .Setenv ("TF_VAR_ssh_key" , sshPublicKey )
2832 os .Setenv ("TF_VAR_ssh_private_key" , sshPrivateKey )
33+
34+ // use trial instance for tests
35+ os .Setenv ("TF_VAR_sm_service_plan" , "trial" )
2936 os .Exit (m .Run ())
3037}
3138
32- func setupOptions (t * testing.T , prefix string , dir string ) * testhelper.TestOptions {
39+ func setupOptions (t * testing.T , prefix string , dir string , region string ) * testhelper.TestOptions {
3340 options := testhelper .TestOptionsDefaultWithVars (& testhelper.TestOptions {
3441 Testing : t ,
3542 TerraformDir : dir ,
3643 Prefix : prefix ,
44+ Region : region ,
3745 })
3846 return options
3947}
4048
4149func TestRunDefaultExample (t * testing.T ) {
4250 t .Parallel ()
4351
44- options := setupOptions (t , "webapp" , defaultExampleTerraformDir )
52+ options := setupOptions (t , "webapp" , defaultExampleTerraformDir , region1 )
4553
4654 output , err := options .RunTestConsistency ()
4755 assert .Nil (t , err , "This should not have errored" )
@@ -51,7 +59,7 @@ func TestRunDefaultExample(t *testing.T) {
5159func TestRunUpgradeExample (t * testing.T ) {
5260 t .Parallel ()
5361
54- options := setupOptions (t , "webapp-upg " , defaultExampleTerraformDir )
62+ options := setupOptions (t , "webapp-u " , defaultExampleTerraformDir , region2 )
5563
5664 output , err := options .RunTestUpgrade ()
5765 if ! options .UpgradeTestSkipped {
0 commit comments