@@ -22,11 +22,14 @@ import (
2222 "github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testschematic"
2323)
2424
25- // Use existing resource group
25+ /*
26+ Global variables
27+ */
2628const resourceGroup = "geretain-test-resources"
2729const yamlLocation = "../common-dev-assets/common-go-assets/common-permanent-resources.yaml"
2830const fullyConfigurableTerraformDir = "solutions/fully-configurable"
2931const AccountSettingsDADir = "solutions/event-routing-account-settings"
32+ const terraformVersion = "terraform_v1.10" // This should match the version in the ibm_catalog.json
3033
3134// Removed "in-che" from validRegions since it isn’t supported under the Standard plan of Event Streams.
3235var validRegions = []string {
@@ -44,7 +47,6 @@ var validRegions = []string{
4447var IgnoreUpdates = []string {
4548 "module.account_routing_settings.ibm_atracker_settings.atracker_settings[0]" ,
4649}
47-
4850var permanentResources map [string ]interface {}
4951
5052func TestMain (m * testing.M ) {
@@ -59,7 +61,7 @@ func TestMain(m *testing.M) {
5961 os .Exit (m .Run ())
6062}
6163
62- func setupexistingOptions (t * testing.T , cloudLogsPrefix string ) (preReqTfOptions * terraform.Options , err error ) {
64+ func setupExistingOptions (t * testing.T , cloudLogsPrefix string ) (preReqTfOptions * terraform.Options , err error ) {
6365
6466 realTerraformDir := "./resources"
6567 tempTerraformDir , tempCopyErr := files .CopyTerraformFolderToTemp (realTerraformDir , cloudLogsPrefix )
@@ -109,11 +111,12 @@ func TestFullyConfigurableInSchematics(t *testing.T) {
109111 Tags : []string {"test-schematic" },
110112 DeleteWorkspaceOnFail : false ,
111113 WaitJobCompleteMinutes : 60 ,
114+ TerraformVersion : terraformVersion ,
112115 })
113116
114117 cloudLogsPrefix := fmt .Sprintf ("cloud-logs-%s" , strings .ToLower (random .UniqueId ()))
115118
116- existingTerraformOptions , err := setupexistingOptions (t , cloudLogsPrefix )
119+ existingTerraformOptions , err := setupExistingOptions (t , cloudLogsPrefix )
117120
118121 if err != nil {
119122 assert .True (t , err == nil , "cloud logs instance creation failed" )
@@ -162,16 +165,18 @@ func TestFullyConfigurableUpgradeInSchematics(t *testing.T) {
162165 "*.tf" ,
163166 fullyConfigurableTerraformDir + "/*.tf" ,
164167 },
165- ResourceGroup : resourceGroup ,
166- TemplateFolder : fullyConfigurableTerraformDir ,
167- Tags : []string {"test-schematic" },
168- DeleteWorkspaceOnFail : false ,
169- WaitJobCompleteMinutes : 60 ,
168+ ResourceGroup : resourceGroup ,
169+ TemplateFolder : fullyConfigurableTerraformDir ,
170+ Tags : []string {"test-schematic" },
171+ DeleteWorkspaceOnFail : false ,
172+ WaitJobCompleteMinutes : 60 ,
173+ CheckApplyResultForUpgrade : true ,
174+ TerraformVersion : terraformVersion ,
170175 })
171176
172177 cloudLogsPrefix := fmt .Sprintf ("cloud-logs-%s" , strings .ToLower (random .UniqueId ()))
173178
174- existingTerraformOptions , err := setupexistingOptions (t , cloudLogsPrefix )
179+ existingTerraformOptions , err := setupExistingOptions (t , cloudLogsPrefix )
175180
176181 if err != nil {
177182 assert .True (t , err == nil , "cloud logs instance creation failed" )
@@ -237,6 +242,7 @@ func TestRunAccountSettings(t *testing.T) {
237242 Tags : []string {"er-da-test" },
238243 DeleteWorkspaceOnFail : false ,
239244 WaitJobCompleteMinutes : 60 ,
245+ TerraformVersion : terraformVersion ,
240246 IgnoreUpdates : testhelper.Exemptions { // Ignore for consistency check
241247 List : IgnoreUpdates ,
242248 },
@@ -274,24 +280,3 @@ func TestActivityTrackerDefaultConfiguration(t *testing.T) {
274280 err := options .RunAddonTest ()
275281 require .NoError (t , err )
276282}
277-
278- func TestActivityTrackerDependencyPermutations (t * testing.T ) {
279- t .Skip ("Skipping dependency permutations until the test is fixed" )
280- t .Parallel ()
281- options := testaddons .TestAddonsOptionsDefault (& testaddons.TestAddonOptions {
282- Testing : t ,
283- Prefix : "act-per" ,
284- AddonConfig : cloudinfo.AddonConfig {
285- OfferingName : "deploy-arch-ibm-activity-tracker" ,
286- OfferingFlavor : "fully-configurable" ,
287- Inputs : map [string ]interface {}{
288- "prefix" : "act-per" ,
289- "region" : validRegions [rand .Intn (len (validRegions ))],
290- "existing_resource_group_name" : resourceGroup ,
291- },
292- },
293- })
294-
295- err := options .RunAddonPermutationTest ()
296- assert .NoError (t , err , "Dependency permutation test should not fail" )
297- }
0 commit comments