Skip to content

Commit ff585cf

Browse files
Add calls to t.Helper() in defered functions (#293)
* Add calls to 't.Helper()' in defered functions. * add changelog --------- Co-authored-by: Austin Valle <[email protected]>
1 parent a8803ed commit ff585cf

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: BUG FIXES
2+
body: 'helper/resource: Fixed internal deferred test helpers to properly report file
3+
and line information in test failures.'
4+
time: 2024-02-29T09:58:04.443444-05:00
5+
custom:
6+
Issue: "292"

helper/resource/testing_new.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ func runNewTest(ctx context.Context, t testing.T, c TestCase, helper *plugintest
6363
}
6464

6565
defer func() {
66+
t.Helper()
67+
6668
var statePreDestroy *terraform.State
6769
var err error
6870
err = runProviderCommand(ctx, t, func() error {
@@ -558,6 +560,8 @@ func testIDRefresh(ctx context.Context, t testing.T, c TestCase, wd *plugintest.
558560
}
559561

560562
defer func() {
563+
t.Helper()
564+
561565
confRequest := teststep.PrepareConfigurationRequest{
562566
Directory: step.ConfigDirectory,
563567
File: step.ConfigFile,

0 commit comments

Comments
 (0)