Skip to content

Commit

Permalink
Merge pull request #378 from hashicorp/binary-acctests-tidy-up-tmpdirs
Browse files Browse the repository at this point in the history
Binary testing: Fix cleanup of temporary directories
  • Loading branch information
kmoe committed Apr 6, 2020
2 parents 9d28501 + dbe9175 commit b8e75fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.9.1 (Unreleased)

BUG FIXES:

* Binary acceptance test driver: fix cleanup of temporary directories [GH-378]

# 1.9.0 (March 26, 2020)

DEPRECATED:
Expand Down
9 changes: 7 additions & 2 deletions helper/resource/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,15 @@ func TestMain(m *testing.M) {
os.Exit(1)
}
} else {
exitCode := m.Run()

if acctest.TestHelper != nil {
defer acctest.TestHelper.Close()
err := acctest.TestHelper.Close()
if err != nil {
log.Printf("Error cleaning up temporary test files: %s", err)
}
}
os.Exit(m.Run())
os.Exit(exitCode)
}
}

Expand Down

0 comments on commit b8e75fe

Please sign in to comment.