Skip to content

Commit

Permalink
Revert to manual cleanup for some tests (bis)
Browse files Browse the repository at this point in the history
- cleanup of these directories fails on Windows
- manual cleanup `err`'s can be intentionally ignored
- using `GinkgoT().TempDir()` automatically cleans up but errors can not
  be ignored
  • Loading branch information
aramprice committed Jul 23, 2024
1 parent 6a2a12d commit 84a00f0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion integration/package/package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,19 @@ var _ = Describe("Package", func() {
vcenterStembuildUsername = helpers.EnvMustExist(vcenterStembuildUsernameVariable)
vcenterStembuildPassword = helpers.EnvMustExist(vcenterStembuildPasswordVariable)

workingDir = GinkgoT().TempDir() // automatically cleaned up
//workingDir = GinkgoT().TempDir() // automatically cleaned up
var err error
workingDir, err = os.MkdirTemp(os.TempDir(), "stembuild-package-test")
Expect(err).NotTo(HaveOccurred())
})

AfterEach(func() {
// TODO: remove once GinkgoT().TempDir() is safe on windows
err := os.RemoveAll(workingDir)
if err != nil {
By(fmt.Sprintf("removing '%s' failed: %s", workingDir, err))
}

if vmPath != "" {
cli.Run([]string{
"vm.destroy",
Expand Down

0 comments on commit 84a00f0

Please sign in to comment.