@@ -55,41 +55,36 @@ func setupOptions(t *testing.T, prefix string, dir string) *testhelper.TestOptio
5555 Region : validRegions [rand .Intn (len (validRegions ))],
5656 })
5757
58- if dir == fsExampleDir {
59- options = testhelper .TestOptionsDefaultWithVars (& testhelper.TestOptions {
60- Testing : t ,
61- TerraformDir : dir ,
62- Prefix : prefix ,
63- ResourceGroup : resourceGroup ,
64- Region : options .Region ,
65- TerraformVars : map [string ]interface {}{
66- "existing_kms_instance_crn" : permanentResources ["hpcs_south_crn" ],
67- "root_key_crn" : permanentResources ["hpcs_south_root_key_crn" ],
68- "kms_endpoint_url" : permanentResources ["hpcs_south_private_endpoint" ],
69- },
70- })
71- }
7258 return options
7359}
7460
75- func TestRunCompleteExample (t * testing.T ) {
61+ func TestCompleteExampleInSchematics (t * testing.T ) {
7662 t .Parallel ()
7763
78- options := setupOptions (t , "event-notification-complete" , completeExampleDir )
79-
80- output , err := options .RunTestConsistency ()
81- assert .Nil (t , err , "This should not have errored" )
82- assert .NotNil (t , output , "Expected some output" )
83- }
64+ var region = validRegions [rand .Intn (len (validRegions ))]
8465
85- func TestRunFSCloudExample (t * testing.T ) {
86- t .Parallel ()
66+ options := testschematic .TestSchematicOptionsDefault (& testschematic.TestSchematicOptions {
67+ Testing : t ,
68+ Prefix : "en-complete" ,
69+ TarIncludePatterns : []string {
70+ "*.tf" ,
71+ completeExampleDir + "/*.tf" ,
72+ },
73+ ResourceGroup : resourceGroup ,
74+ TemplateFolder : completeExampleDir ,
75+ Tags : []string {"test-schematic" },
76+ DeleteWorkspaceOnFail : false ,
77+ WaitJobCompleteMinutes : 60 ,
78+ })
8779
88- options := setupOptions (t , "en-fs" , fsExampleDir )
80+ options .TerraformVars = []testschematic.TestSchematicTerraformVar {
81+ {Name : "ibmcloud_api_key" , Value : options .RequiredEnvironmentVars ["TF_VAR_ibmcloud_api_key" ], DataType : "string" , Secure : true },
82+ {Name : "prefix" , Value : options .Prefix , DataType : "string" },
83+ {Name : "region" , Value : region , DataType : "string" },
84+ }
8985
90- output , err := options .RunTestConsistency ()
86+ err := options .RunSchematicTest ()
9187 assert .Nil (t , err , "This should not have errored" )
92- assert .NotNil (t , output , "Expected some output" )
9388}
9489
9590func TestDAInSchematics (t * testing.T ) {
@@ -104,7 +99,6 @@ func TestDAInSchematics(t *testing.T) {
10499 "*.tf" ,
105100 solutionDADir + "/*.tf" ,
106101 },
107- ResourceGroup : resourceGroup ,
108102 TemplateFolder : solutionDADir ,
109103 Tags : []string {"test-schematic" },
110104 DeleteWorkspaceOnFail : false ,
@@ -113,8 +107,8 @@ func TestDAInSchematics(t *testing.T) {
113107
114108 options .TerraformVars = []testschematic.TestSchematicTerraformVar {
115109 {Name : "ibmcloud_api_key" , Value : options .RequiredEnvironmentVars ["TF_VAR_ibmcloud_api_key" ], DataType : "string" , Secure : true },
116- {Name : "resource_group_name" , Value : options .Prefix , DataType : "string" },
117110 {Name : "region" , Value : region , DataType : "string" },
111+ {Name : "resource_group_name" , Value : options .Prefix , DataType : "string" },
118112 {Name : "existing_kms_instance_crn" , Value : permanentResources ["hpcs_south_crn" ], DataType : "string" },
119113 {Name : "kms_endpoint_url" , Value : permanentResources ["hpcs_south_private_endpoint" ], DataType : "string" },
120114 {Name : "cross_region_location" , Value : "us" , DataType : "string" },
@@ -124,6 +118,39 @@ func TestDAInSchematics(t *testing.T) {
124118 assert .Nil (t , err , "This should not have errored" )
125119}
126120
121+ func TestFSCloudInSchematics (t * testing.T ) {
122+ t .Parallel ()
123+
124+ var region = validRegions [rand .Intn (len (validRegions ))]
125+
126+ options := testschematic .TestSchematicOptionsDefault (& testschematic.TestSchematicOptions {
127+ Testing : t ,
128+ Prefix : "en-fs" ,
129+ TarIncludePatterns : []string {
130+ "*.tf" ,
131+ fsExampleDir + "/*.tf" ,
132+ "modules/fscloud/*.tf" ,
133+ },
134+ ResourceGroup : resourceGroup ,
135+ TemplateFolder : fsExampleDir ,
136+ Tags : []string {"test-schematic" },
137+ DeleteWorkspaceOnFail : false ,
138+ WaitJobCompleteMinutes : 60 ,
139+ })
140+
141+ options .TerraformVars = []testschematic.TestSchematicTerraformVar {
142+ {Name : "ibmcloud_api_key" , Value : options .RequiredEnvironmentVars ["TF_VAR_ibmcloud_api_key" ], DataType : "string" , Secure : true },
143+ {Name : "region" , Value : region , DataType : "string" },
144+ {Name : "prefix" , Value : options .Prefix , DataType : "string" },
145+ {Name : "existing_kms_instance_crn" , Value : permanentResources ["hpcs_south_crn" ], DataType : "string" },
146+ {Name : "kms_endpoint_url" , Value : permanentResources ["hpcs_south_private_endpoint" ], DataType : "string" },
147+ {Name : "root_key_crn" , Value : permanentResources ["hpcs_south_root_key_crn" ], DataType : "string" },
148+ }
149+
150+ err := options .RunSchematicTest ()
151+ assert .Nil (t , err , "This should not have errored" )
152+ }
153+
127154func TestRunUpgradeDASolution (t * testing.T ) {
128155 t .Parallel ()
129156
0 commit comments