@@ -34,32 +34,6 @@ func TestMain(m *testing.M) {
3434 os .Exit (m .Run ())
3535}
3636
37- func setupAppsExampleOptions (t * testing.T , prefix string , terraformDir string ) * testhelper.TestOptions {
38- options := testhelper .TestOptionsDefault (& testhelper.TestOptions {
39- Testing : t ,
40- TerraformDir : terraformDir ,
41- Prefix : prefix ,
42- ResourceGroup : resourceGroup ,
43- })
44- // need to ignore because of a provider issue: https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4719
45- options .IgnoreUpdates = testhelper.Exemptions {
46- List : []string {
47- "module.code_engine.module.app[\" " + options .Prefix + "-app\" ].ibm_code_engine_app.ce_app" ,
48- "module.code_engine.module.app[\" " + options .Prefix + "-app2\" ].ibm_code_engine_app.ce_app" ,
49- },
50- }
51- options .TerraformVars = map [string ]interface {}{
52- "resource_group" : resourceGroup ,
53- "prefix" : options .Prefix ,
54- "existing_sm_instance_guid" : permanentResources ["secretsManagerGuid" ],
55- "existing_sm_instance_region" : permanentResources ["secretsManagerRegion" ],
56- "existing_cert_secret_id" : permanentResources ["cePublicCertId" ],
57- "existing_cert_common_name" : "goldeneye.dev.cloud.ibm.com" ,
58- }
59-
60- return options
61- }
62-
6337func setupJobsExampleOptions (t * testing.T , prefix string , terraformDir string ) * testhelper.TestOptions {
6438 options := testhelper .TestOptionsDefault (& testhelper.TestOptions {
6539 Testing : t ,
@@ -82,13 +56,44 @@ func setupJobsExampleOptions(t *testing.T, prefix string, terraformDir string) *
8256 return options
8357}
8458
85- func TestRunAppsExample (t * testing.T ) {
59+ func TestRunAppsExamplesInSchematics (t * testing.T ) {
8660 t .Parallel ()
8761
88- options := setupAppsExampleOptions (t , "ce-apps" , appsExampleDir )
89- output , err := options .RunTestConsistency ()
62+ options := testschematic .TestSchematicOptionsDefault (& testschematic.TestSchematicOptions {
63+ Testing : t ,
64+ TemplateFolder : appsExampleDir ,
65+ Prefix : "ce-apps" ,
66+ TarIncludePatterns : []string {
67+ "*.tf" ,
68+ appsExampleDir + "/*.tf" ,
69+ "modules/app/*.tf" ,
70+ "modules/binding/*.tf" ,
71+ "modules/config_map/*.tf" ,
72+ "modules/project/*.tf" ,
73+ "modules/secret/*.tf" ,
74+ "modules/build/*.tf" ,
75+ "modules/domain_mapping/*.tf" ,
76+ "modules/job/*.tf" ,
77+ },
78+ ResourceGroup : resourceGroup ,
79+ Tags : []string {"test-schematic" },
80+ DeleteWorkspaceOnFail : false ,
81+ WaitJobCompleteMinutes : 60 ,
82+ })
83+
84+ options .TerraformVars = []testschematic.TestSchematicTerraformVar {
85+ {Name : "ibmcloud_api_key" , Value : options .RequiredEnvironmentVars ["TF_VAR_ibmcloud_api_key" ], DataType : "string" , Secure : true },
86+ {Name : "resource_group" , Value : options .ResourceGroup , DataType : "string" },
87+ {Name : "prefix" , Value : options .Prefix + "-app" , DataType : "string" },
88+ {Name : "existing_sm_instance_guid" , Value : permanentResources ["secretsManagerGuid" ], DataType : "string" },
89+ {Name : "existing_sm_instance_region" , Value : permanentResources ["secretsManagerRegion" ], DataType : "string" },
90+ {Name : "ca_name" , Value : permanentResources ["certificateAuthorityName" ], DataType : "string" },
91+ {Name : "dns_provider_name" , Value : permanentResources ["dnsProviderName" ], DataType : "string" },
92+ {Name : "region" , Value : options .Region , DataType : "string" },
93+ }
94+
95+ err := options .RunSchematicTest ()
9096 assert .Nil (t , err , "This should not have errored" )
91- assert .NotNil (t , output , "Expected some output" )
9297}
9398
9499func TestRunJobsExample (t * testing.T ) {
0 commit comments