@@ -55,41 +55,36 @@ func setupOptions(t *testing.T, prefix string, dir string) *testhelper.TestOptio
55
55
Region : validRegions [rand .Intn (len (validRegions ))],
56
56
})
57
57
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
- }
72
58
return options
73
59
}
74
60
75
- func TestRunCompleteExample (t * testing.T ) {
61
+ func TestCompleteExampleInSchematics (t * testing.T ) {
76
62
t .Parallel ()
77
63
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 ))]
84
65
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
+ })
87
79
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
+ }
89
85
90
- output , err := options .RunTestConsistency ()
86
+ err := options .RunSchematicTest ()
91
87
assert .Nil (t , err , "This should not have errored" )
92
- assert .NotNil (t , output , "Expected some output" )
93
88
}
94
89
95
90
func TestDAInSchematics (t * testing.T ) {
@@ -104,7 +99,6 @@ func TestDAInSchematics(t *testing.T) {
104
99
"*.tf" ,
105
100
solutionDADir + "/*.tf" ,
106
101
},
107
- ResourceGroup : resourceGroup ,
108
102
TemplateFolder : solutionDADir ,
109
103
Tags : []string {"test-schematic" },
110
104
DeleteWorkspaceOnFail : false ,
@@ -113,8 +107,8 @@ func TestDAInSchematics(t *testing.T) {
113
107
114
108
options .TerraformVars = []testschematic.TestSchematicTerraformVar {
115
109
{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" },
117
110
{Name : "region" , Value : region , DataType : "string" },
111
+ {Name : "resource_group_name" , Value : options .Prefix , DataType : "string" },
118
112
{Name : "existing_kms_instance_crn" , Value : permanentResources ["hpcs_south_crn" ], DataType : "string" },
119
113
{Name : "kms_endpoint_url" , Value : permanentResources ["hpcs_south_private_endpoint" ], DataType : "string" },
120
114
{Name : "cross_region_location" , Value : "us" , DataType : "string" },
@@ -124,6 +118,39 @@ func TestDAInSchematics(t *testing.T) {
124
118
assert .Nil (t , err , "This should not have errored" )
125
119
}
126
120
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
+
127
154
func TestRunUpgradeDASolution (t * testing.T ) {
128
155
t .Parallel ()
129
156
0 commit comments