@@ -61,8 +61,6 @@ func TestMain(m *testing.M) {
6161func TestRunStandardSolutionSchematics (t * testing.T ) {
6262 t .Parallel ()
6363
64- enableKibana := false
65-
6664 options := testschematic .TestSchematicOptionsDefault (& testschematic.TestSchematicOptions {
6765 Testing : t ,
6866 TarIncludePatterns : []string {
@@ -110,44 +108,12 @@ func TestRunStandardSolutionSchematics(t *testing.T) {
110108 {Name : "admin_pass" , Value : GetRandomAdminPassword (t ), DataType : "string" },
111109 {Name : "admin_pass_secrets_manager_secret_group" , Value : options .Prefix , DataType : "string" },
112110 {Name : "admin_pass_secrets_manager_secret_name" , Value : options .Prefix , DataType : "string" },
113- {Name : "enable_kibana_dashboard" , Value : enableKibana , DataType : "bool" },
111+ {Name : "enable_kibana_dashboard" , Value : true , DataType : "bool" },
114112 {Name : "provider_visibility" , Value : "private" , DataType : "string" },
115113 {Name : "prefix" , Value : options .Prefix , DataType : "string" },
116114 {Name : "admin_pass" , Value : GetRandomAdminPassword (t ), DataType : "string" },
117115 }
118116
119- if enableKibana {
120- existingProjectID := os .Getenv ("EXISTING_CODE_ENGINE_PROJECT_ID" )
121- kibanaImageSecret := os .Getenv ("KIBANA_IMAGE_SECRET" )
122- kibanaRegistryUsername := os .Getenv ("KIBANA_REGISTRY_USERNAME" )
123- kibanaRegistryToken := os .Getenv ("KIBANA_REGISTRY_PERSONAL_ACCESS_TOKEN" )
124- kibanaRegistryServer := os .Getenv ("KIBANA_REGISTRY_SERVER" )
125-
126- if existingProjectID == "" {
127- t .Fatal ("existing_code_engine_project_id env var must be set when enable_kibana_dashboard is true" )
128- }
129- if kibanaImageSecret == "" {
130- t .Fatal ("kibana_image_secret env var must be set when enable_kibana_dashboard is true" )
131- }
132- if kibanaRegistryUsername == "" {
133- t .Fatal ("kibana_registry_username env var must be set when enable_kibana_dashboard is true" )
134- }
135- if kibanaRegistryToken == "" {
136- t .Fatal ("kibana_personal_access_token env var must be set when enable_kibana_dashboard is true" )
137- }
138- if kibanaRegistryServer == "" {
139- t .Fatal ("kibana_registry_server env var must be set when enable_kibana_dashboard is true" )
140- }
141-
142- options .TerraformVars = append (options .TerraformVars ,
143- testschematic.TestSchematicTerraformVar {Name : "existing_code_engine_project_id" , Value : existingProjectID , DataType : "string" },
144- testschematic.TestSchematicTerraformVar {Name : "kibana_image_secret" , Value : kibanaImageSecret , DataType : "string" },
145- testschematic.TestSchematicTerraformVar {Name : "kibana_registry_username" , Value : kibanaRegistryUsername , DataType : "string" },
146- testschematic.TestSchematicTerraformVar {Name : "kibana_registry_personal_access_token" , Value : kibanaRegistryToken , DataType : "string" },
147- testschematic.TestSchematicTerraformVar {Name : "kibana_registry_server" , Value : kibanaRegistryServer , DataType : "string" },
148- )
149- }
150-
151117 err := options .RunSchematicTest ()
152118 assert .Nil (t , err , "This should not have errored" )
153119}
@@ -313,38 +279,10 @@ func TestPlanValidation(t *testing.T) {
313279 }
314280
315281 // Test the DA when using Kibana dashboard and existing KMS instance
316-
317- tfVarsMap := map [string ]map [string ]interface {}{}
318-
319- if os .Getenv ("ENABLE_KIBANA_DASHBOARD" ) == "true" {
320- tfVarsMap ["standardSolutionWithKibanaDashboardVars" ] = map [string ]interface {}{
321- "existing_kms_instance_crn" : permanentResources ["hpcs_south_crn" ],
322- "kibana_image_secret" : os .Getenv ("KIBANA_IMAGE_SECRET" ),
323- "kibana_registry_username" : os .Getenv ("KIBANA_REGISTRY_USERNAME" ),
324- "kibana_registry_personal_access_token" : os .Getenv ("KIBANA_REGISTRY_PERSONAL_ACCESS_TOKEN" ),
325- "kibana_registry_server" : os .Getenv ("KIBANA_REGISTRY_SERVER" ),
326- "existingProjectID" : os .Getenv ("EXISTING_CODE_ENGINE_PROJECT_ID" ),
327- "plan" : "enterprise" ,
328- }
329- }
330-
331- for name , tfVars := range tfVarsMap {
332- t .Run (name , func (t * testing.T ) {
333- for key , value := range tfVars {
334- options .TerraformOptions .Vars [key ] = value
335- }
336-
337- _ , err := terraform .InitE (t , options .TerraformOptions )
338- require .NoError (t , err )
339-
340- output , err := terraform .PlanE (t , options .TerraformOptions )
341- assert .Nil (t , err )
342- assert .NotNil (t , output )
343-
344- for key := range tfVars {
345- delete (options .TerraformOptions .Vars , key )
346- }
347- })
282+ var standardSolutionWithKibanaDashboardVars = map [string ]interface {}{
283+ "enable_kibana_dashboard" : true ,
284+ "existing_kms_instance_crn" : permanentResources ["hpcs_south_crn" ],
285+ "plan" : "enterprise" ,
348286 }
349287
350288 // Test the DA when using IBM owned encryption key
@@ -353,9 +291,10 @@ func TestPlanValidation(t *testing.T) {
353291 }
354292
355293 // Create a map of the variables
356- tfVarsMap = map [string ]map [string ]interface {}{
357- "standardSolutionWithElserModelVars" : standardSolutionWithElserModelVars ,
358- "standardSolutionWithUseIbmOwnedEncKey" : standardSolutionWithUseIbmOwnedEncKey ,
294+ tfVarsMap := map [string ]map [string ]interface {}{
295+ "standardSolutionWithElserModelVars" : standardSolutionWithElserModelVars ,
296+ "standardSolutionWithKibanaDashboardVars" : standardSolutionWithKibanaDashboardVars ,
297+ "standardSolutionWithUseIbmOwnedEncKey" : standardSolutionWithUseIbmOwnedEncKey ,
359298 }
360299
361300 _ , initErr := terraform .InitE (t , options .TerraformOptions )
0 commit comments