Skip to content

Commit

Permalink
Move defers to make sure we always cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cbuto committed Mar 9, 2021
1 parent 28474d5 commit 1df9acd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/terraform/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,17 @@ func TestInitPluginDir(t *testing.T) {

pluginDir, err := ioutil.TempDir("", t.Name())
require.NoError(t, err)
defer os.RemoveAll(pluginDir)

terraformFixture := "../../test/fixtures/terraform-basic-configuration"

initializePluginsFolder, err := files.CopyTerraformFolderToTemp(terraformFixture, t.Name())
require.NoError(t, err)
defer os.RemoveAll(initializePluginsFolder)

testFolder, err := files.CopyTerraformFolderToTemp(terraformFixture, t.Name())
require.NoError(t, err)

defer os.RemoveAll(initializePluginsFolder)
defer os.RemoveAll(testFolder)
defer os.RemoveAll(pluginDir)

terraformOptions := &Options{
TerraformDir: initializePluginsFolder,
Expand Down

0 comments on commit 1df9acd

Please sign in to comment.