From cb32cb8947bf15b0742f7dfb0e6bb92b9d733de8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 20 Apr 2016 09:25:23 -0700 Subject: [PATCH] helper/resource: error if id-only check didn't run --- helper/resource/testing.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/helper/resource/testing.go b/helper/resource/testing.go index 227f537fed..29a767f811 100644 --- a/helper/resource/testing.go +++ b/helper/resource/testing.go @@ -181,6 +181,9 @@ func Test(t TestT, c TestCase) { // this fails. If refresh isn't read-only, then this will have // caught a different bug. if idRefreshCheck != nil { + log.Printf( + "[WARN] Test: Running ID-only refresh check on %s", + idRefreshCheck.Primary.ID) if err := testIDOnlyRefresh(opts, idRefreshCheck); err != nil { t.Error(fmt.Sprintf( "ID-Only refresh test failure: %s", err)) @@ -190,6 +193,11 @@ func Test(t TestT, c TestCase) { } } + // If we never checked an id-only refresh, it is a failure + if idRefreshCheck == nil { + t.Error("ID-only refresh check never ran.") + } + // If we have a state, then run the destroy if state != nil { destroyStep := TestStep{