Skip to content

Commit

Permalink
add env var to skip cleanup temp test folder for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
lonegunmanb committed Mar 16, 2023
1 parent a75409f commit d95b157
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion e2etest.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ func initAndApplyAndIdempotentTest(t *testing.T, moduleRootPath string, exampleR

tmpDir := copyTerraformFolderToTemp(t, moduleRootPath, exampleRelativePath)
defer func() {
_ = os.RemoveAll(filepath.Clean(tmpDir))
skip := os.Getenv("SKIP_CLEAN_TMP")
if skip == "" {
_ = os.RemoveAll(filepath.Clean(tmpDir))
}
}()
option.TerraformDir = tmpDir

Expand Down
5 changes: 4 additions & 1 deletion upgradetest.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ func moduleUpgrade(t *testing.T, owner string, repo string, moduleFolderRelative
}
tmpTestDir := test_structure.CopyTerraformFolderToTemp(t, tmpDirForTag, moduleFolderRelativeToRoot)
defer func() {
_ = os.RemoveAll(filepath.Clean(tmpTestDir))
skip := os.Getenv("SKIP_CLEAN_TMP")
if skip == "" {
_ = os.RemoveAll(filepath.Clean(tmpTestDir))
}
}()
return diffTwoVersions(t, opts, tmpTestDir, newModulePath)
}
Expand Down

0 comments on commit d95b157

Please sign in to comment.