0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2025-01-20 22:52:51 -05:00

compliance: don't leak test directory

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
This commit is contained in:
Tycho Andersen 2020-03-09 15:08:31 -06:00 committed by Ramkumar Chinchani
parent 404c83fbc1
commit 4774aa81b3

View file

@ -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)
}