diff --git a/helper/resource/testing.go b/helper/resource/testing.go index 9b9723356..a2ea003af 100644 --- a/helper/resource/testing.go +++ b/helper/resource/testing.go @@ -209,13 +209,16 @@ func testStep( opts.Destroy = step.Destroy ctx := terraform.NewContext(&opts) if ws, es := ctx.Validate(); len(ws) > 0 || len(es) > 0 { - estrs := make([]string, len(es)) - for i, e := range es { - estrs[i] = e.Error() + if len(es) > 0 { + estrs := make([]string, len(es)) + for i, e := range es { + estrs[i] = e.Error() + } + return state, fmt.Errorf( + "Configuration is invalid.\n\nWarnings: %#v\n\nErrors: %#v", + ws, estrs) } - return state, fmt.Errorf( - "Configuration is invalid.\n\nWarnings: %#v\n\nErrors: %#v", - ws, estrs) + log.Printf("[WARN] Config warnings: %#v", ws) } // Refresh!