@@ -184,22 +184,22 @@ func TestHelmNICTemplateNegative(t *testing.T) {
184
184
expectedErrorMsgs : []string {"missing properties 'port', 'path'" , "port is required" },
185
185
},
186
186
"globalConfigInvalidFormat" : {
187
- valuesFile : "testdata/global-config-invalid-format.yaml" ,
188
- releaseName : "global-config-invalid-format" ,
189
- namespace : "default" ,
190
- expectedErrorMsg : "globalConfiguration.customName must contain exactly one '/' separator" ,
187
+ valuesFile : "testdata/global-config-invalid-format.yaml" ,
188
+ releaseName : "global-config-invalid-format" ,
189
+ namespace : "default" ,
190
+ expectedErrorMsgs : [] string { "globalConfiguration.customName must contain exactly one '/' separator" } ,
191
191
},
192
192
"globalConfigMultipleSlashes" : {
193
- valuesFile : "testdata/global-config-multiple-slashes.yaml" ,
194
- releaseName : "global-config-multiple-slashes" ,
195
- namespace : "default" ,
196
- expectedErrorMsg : "globalConfiguration.customName must contain exactly one '/' separator" ,
193
+ valuesFile : "testdata/global-config-multiple-slashes.yaml" ,
194
+ releaseName : "global-config-multiple-slashes" ,
195
+ namespace : "default" ,
196
+ expectedErrorMsgs : [] string { "globalConfiguration.customName must contain exactly one '/' separator" } ,
197
197
},
198
198
"globalConfigEmptyName" : {
199
- valuesFile : "testdata/global-config-empty-name.yaml" ,
200
- releaseName : "global-config-empty-name" ,
201
- namespace : "default" ,
202
- expectedErrorMsg : "globalConfiguration.customName namespace and name parts cannot be empty" ,
199
+ valuesFile : "testdata/global-config-empty-name.yaml" ,
200
+ releaseName : "global-config-empty-name" ,
201
+ namespace : "default" ,
202
+ expectedErrorMsgs : [] string { "globalConfiguration.customName namespace and name parts cannot be empty" } ,
203
203
},
204
204
}
205
205
@@ -224,11 +224,19 @@ func TestHelmNICTemplateNegative(t *testing.T) {
224
224
t .Fatalf ("Expected helm template to fail for invalid configuration, but it succeeded" )
225
225
}
226
226
227
+ << << << < HEAD
227
228
errMsg := err .Error ()
228
229
for _ , expected := range tc .expectedErrorMsgs {
229
230
if strings .Contains (errMsg , expected ) {
230
231
t .Logf ("Expected failure occurred: %s" , errMsg )
231
232
return
233
+ == == == =
234
+ if len (tc .expectedErrorMsgs ) > 0 {
235
+ for _ , expectedMsg := range tc .expectedErrorMsgs {
236
+ if ! strings .Contains (err .Error (), expectedMsg ) {
237
+ t .Fatalf ("Expected error to contain '%s', but got: %s" , expectedMsg , err .Error ())
238
+ }
239
+ >> >> >> > c8cf19e89 (fixing copilot mentioned error )
232
240
}
233
241
}
234
242
0 commit comments