Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Nov 20, 2023
1 parent e5ab677 commit 5df8a23
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions test/test-cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

type testCluster struct {
path string
originalWorkDir string
path string
origWorkDir string
}

func newTestCluster(path string) (*testCluster, error) {
Expand All @@ -18,15 +18,16 @@ func newTestCluster(path string) (*testCluster, error) {
}

if path == "" {
parentDir := filepath.Dir(workDir)
if err := os.Chdir(parentDir); err != nil {
return nil, err
}
path = filepath.Dir(workDir)
}

if err := os.Chdir(path); err != nil {
return nil, err
}

return &testCluster{
path: path,
originalWorkDir: workDir,
path: path,
origWorkDir: workDir,
}, nil
}

Expand All @@ -39,5 +40,5 @@ func (t *testCluster) stop() ([]byte, error) {
}

func (t *testCluster) reset() error {
return os.Chdir(t.originalWorkDir)
return os.Chdir(t.origWorkDir)
}

0 comments on commit 5df8a23

Please sign in to comment.