From 72c061ef481f20801968b3bffda393bf73555771 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 22 Feb 2024 14:03:42 -0500 Subject: [PATCH 1/2] Add calls to 't.Helper()' in defered functions. --- helper/resource/testing_new.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helper/resource/testing_new.go b/helper/resource/testing_new.go index 2464e3cc7..0a7c7e7f7 100644 --- a/helper/resource/testing_new.go +++ b/helper/resource/testing_new.go @@ -63,6 +63,8 @@ func runNewTest(ctx context.Context, t testing.T, c TestCase, helper *plugintest } defer func() { + t.Helper() + var statePreDestroy *terraform.State var err error err = runProviderCommand(ctx, t, func() error { @@ -558,6 +560,8 @@ func testIDRefresh(ctx context.Context, t testing.T, c TestCase, wd *plugintest. } defer func() { + t.Helper() + confRequest := teststep.PrepareConfigurationRequest{ Directory: step.ConfigDirectory, File: step.ConfigFile, From 04d1b108c0bd4c578d9c3d03266738eded3e7313 Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Thu, 29 Feb 2024 09:58:14 -0500 Subject: [PATCH 2/2] add changelog --- .changes/unreleased/BUG FIXES-20240229-095804.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/BUG FIXES-20240229-095804.yaml diff --git a/.changes/unreleased/BUG FIXES-20240229-095804.yaml b/.changes/unreleased/BUG FIXES-20240229-095804.yaml new file mode 100644 index 000000000..0db59ca8c --- /dev/null +++ b/.changes/unreleased/BUG FIXES-20240229-095804.yaml @@ -0,0 +1,6 @@ +kind: BUG FIXES +body: 'helper/resource: Fixed internal deferred test helpers to properly report file + and line information in test failures.' +time: 2024-02-29T09:58:04.443444-05:00 +custom: + Issue: "292"