Skip to content

Commit

Permalink
Add calls to t.Helper() in defered functions (#293)
Browse files Browse the repository at this point in the history
* Add calls to 't.Helper()' in defered functions.

* add changelog

---------

Co-authored-by: Austin Valle <austinvalle@gmail.com>
  • Loading branch information
ewbankkit and austinvalle authored Feb 29, 2024
1 parent a8803ed commit ff585cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/BUG FIXES-20240229-095804.yaml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 4 additions & 0 deletions helper/resource/testing_new.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ff585cf

Please sign in to comment.