@@ -199,7 +199,7 @@ func Test_StoreTypesCreateFromTemplatesCmd(t *testing.T) {
199199
200200 // Attempt to create the store type
201201 shortName := storeType ["ShortName" ].(string )
202- createStoreTypeTest (t , shortName )
202+ createStoreTypeTest (t , shortName , false )
203203 }
204204 createAllStoreTypes (t , storeTypes )
205205}
@@ -288,8 +288,9 @@ func deleteStoreTypeTest(t *testing.T, shortName string, allowFail bool) {
288288 deleteStoreOutput := captureOutput (
289289 func () {
290290 if checkIsUnDeleteable (shortName ) {
291- t .Skip ("Not processing un-deletable store-type: " , shortName )
292- return
291+ allowFail = true
292+ //t.Skip("Not processing un-deletable store-type: ", shortName)
293+ //return
293294 }
294295
295296 err := testCmd .Execute ()
@@ -326,38 +327,45 @@ func checkIsUnDeleteable(shortName string) bool {
326327 return false
327328}
328329
329- func createStoreTypeTest (t * testing.T , shortName string ) {
330+ func createStoreTypeTest (t * testing.T , shortName string , allowFail bool ) {
330331 t .Run (
331332 fmt .Sprintf ("CreateStore %s" , shortName ), func (t * testing.T ) {
332333 testCmd := RootCmd
333334 if checkIsUnDeleteable (shortName ) {
334- t .Skip ( "Not processing un-deletable store-type: " , shortName )
335- return
335+ t .Logf ( "WARNING: Allowing un-deletable store-type: %s to FAIL " , shortName )
336+ allowFail = true
336337 }
337338 deleteStoreTypeTest (t , shortName , true )
338339 testCmd .SetArgs ([]string {"store-types" , "create" , "--name" , shortName })
339340 createStoreOutput := captureOutput (
340341 func () {
341342 err := testCmd .Execute ()
342- assert .NoError (t , err )
343+ if ! allowFail {
344+ assert .NoError (t , err )
345+ }
343346 },
344347 )
345348
346349 // check if any of the undeleteable_exceptions are in the output
347350 for _ , exception := range UndeleteableExceptions {
348351 if strings .Contains (createStoreOutput , exception ) {
349- t .Skip ("Not processing un-deletable store-type: " , exception )
350- return
352+ t .Logf (
353+ "WARNING: wxpected error encountered '%s' allowing un-deletable store-type: %s to FAIL" ,
354+ exception , shortName ,
355+ )
356+ allowFail = true
351357 }
352358 }
353359
354- if strings .Contains (createStoreOutput , "already exists" ) {
355- assert .Fail (t , fmt .Sprintf ("Store type %s already exists" , shortName ))
356- } else if ! strings .Contains (createStoreOutput , "created with ID" ) {
357- assert .Fail (t , fmt .Sprintf ("Store type %s was not created: %s" , shortName , createStoreOutput ))
360+ if ! allowFail {
361+ if strings .Contains (createStoreOutput , "already exists" ) {
362+ assert .Fail (t , fmt .Sprintf ("Store type %s already exists" , shortName ))
363+ } else if ! strings .Contains (createStoreOutput , "created with ID" ) {
364+ assert .Fail (t , fmt .Sprintf ("Store type %s was not created: %s" , shortName , createStoreOutput ))
365+ }
358366 }
359367 // Delete again after create
360- deleteStoreTypeTest (t , shortName , false )
368+ deleteStoreTypeTest (t , shortName , allowFail )
361369 },
362370 )
363371}
0 commit comments