controllers: cleanup TestStorageCopyFromPath files
Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
parent
4ac2c1a26c
commit
22f129074c
|
@ -317,15 +317,11 @@ func TestStorageCopyFromPath(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
createFile := func(file *File) (absPath string, err error) {
|
createFile := func(file *File) (absPath string, err error) {
|
||||||
defer func() {
|
|
||||||
if err != nil && dir != "" {
|
|
||||||
os.RemoveAll(dir)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
dir, err = os.MkdirTemp("", "test-files-")
|
dir, err = os.MkdirTemp("", "test-files-")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
t.Cleanup(cleanupStoragePath(dir))
|
||||||
absPath = filepath.Join(dir, file.Name)
|
absPath = filepath.Join(dir, file.Name)
|
||||||
if err = os.MkdirAll(filepath.Dir(absPath), 0755); err != nil {
|
if err = os.MkdirAll(filepath.Dir(absPath), 0755); err != nil {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue