mirror of
https://github.com/project-zot/zot.git
synced 2026-06-15 20:07:55 +08:00
compliance: don't leak test directory
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
This commit is contained in:
committed by
Ramkumar Chinchani
parent
404c83fbc1
commit
4774aa81b3
@@ -5,6 +5,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -56,7 +57,6 @@ func startServer() (*api.Controller, string) {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
//defer os.RemoveAll(dir)
|
||||
ctrl.Config.Storage.RootDirectory = dir
|
||||
go func() {
|
||||
// this blocks
|
||||
@@ -80,4 +80,5 @@ func startServer() (*api.Controller, string) {
|
||||
|
||||
func stopServer(ctrl *api.Controller) {
|
||||
ctrl.Server.Shutdown(context.Background())
|
||||
os.RemoveAll(ctrl.Config.Storage.RootDirectory)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user