From 5f677a6925786f8d9f246391331b6e53520bb333 Mon Sep 17 00:00:00 2001 From: Adam Snyder Date: Sat, 2 Apr 2022 11:32:31 -0700 Subject: [PATCH 1/2] Improve "unsupported test mode" message The "unsupported test mode" message does not tell you which step of the test failed, unlike the other fatal errors in the `runNewTest` function here. This change adds the step number to the error message to make it more useful and more consistent. --- helper/resource/testing_new.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper/resource/testing_new.go b/helper/resource/testing_new.go index 9c19b0d17ce..9546edae758 100644 --- a/helper/resource/testing_new.go +++ b/helper/resource/testing_new.go @@ -197,7 +197,7 @@ func runNewTest(ctx context.Context, t testing.T, c TestCase, helper *plugintest continue } - t.Fatal("Unsupported test mode") + t.Fatalf("Step %d/%d, unsupported test mode", i+1, len(c.Steps)) } } From 3e7e5fdaf87debd5f42db18a47535cb1071fe1db Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 12 Apr 2022 15:02:40 -0400 Subject: [PATCH 2/2] Apply suggestions from code review --- helper/resource/testing_new.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper/resource/testing_new.go b/helper/resource/testing_new.go index 9546edae758..1b93e0bb962 100644 --- a/helper/resource/testing_new.go +++ b/helper/resource/testing_new.go @@ -197,7 +197,7 @@ func runNewTest(ctx context.Context, t testing.T, c TestCase, helper *plugintest continue } - t.Fatalf("Step %d/%d, unsupported test mode", i+1, len(c.Steps)) + t.Fatalf("Step %d/%d, unsupported test mode", i+1, len(c.Steps)) } }