Skip to content

Commit

Permalink
fix: should fix the directory not empty panic
Browse files Browse the repository at this point in the history
Signed-off-by: Kit Patella <[email protected]>
  • Loading branch information
mkcp committed Sep 25, 2024
1 parent 9059544 commit 4a0d6ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/test/external/ext_in_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,9 @@ func (suite *ExtInClusterTestSuite) Test_1_Deploy() {
initArgs = append(initArgs, inClusterInitCredentialArgs...)
err := exec.CmdWithPrint(zarfBinPath, initArgs...)
suite.NoError(err, "unable to initialize the k8s server with zarf")

// Create tempdir
temp := suite.T().TempDir()
defer func(name string) {
err := os.Remove(name)
suite.NoError(err)
}(temp)
createPodInfoPackageWithInsecureSources(suite.T(), temp)

// Deploy the flux example package
Expand Down Expand Up @@ -201,8 +199,11 @@ func (suite *ExtInClusterTestSuite) Test_1_Deploy() {
err = pkgkubernetes.WaitForReady(waitCtx, c.Watcher, objs)
suite.NoError(err)

// Cleanup
_, _, err = exec.CmdWithTesting(suite.T(), exec.PrintCfg(), zarfBinPath, "destroy", "--confirm")
suite.NoError(err, "unable to teardown zarf")
err = os.RemoveAll(temp)
suite.NoError(err, "unable to remove tempdir")
}

func TestExtInClusterTestSuite(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions src/test/external/ext_out_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@ func (suite *ExtOutClusterTestSuite) Test_2_DeployGitOps() {
deployArgs = []string{"package", "deploy", path, "--confirm"}
err = exec.CmdWithPrint(zarfBinPath, deployArgs...)
suite.NoError(err)
_ = os.RemoveAll(temp) //nolint:errcheck
// suite.NoError(err, "unable to remove tempdir")

err = os.RemoveAll(temp)
suite.NoError(err, "unable to remove tempdir")
}

func (suite *ExtOutClusterTestSuite) Test_3_AuthToPrivateHelmChart() {
Expand Down

0 comments on commit 4a0d6ef

Please sign in to comment.