mirror of
https://github.com/project-zot/zot.git
synced 2025-01-27 23:01:43 -05:00
compliance: don't leak test directory
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
This commit is contained in:
parent
404c83fbc1
commit
4774aa81b3
1 changed files with 2 additions and 1 deletions
|
@ -5,6 +5,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -56,7 +57,6 @@ func startServer() (*api.Controller, string) {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
//defer os.RemoveAll(dir)
|
|
||||||
ctrl.Config.Storage.RootDirectory = dir
|
ctrl.Config.Storage.RootDirectory = dir
|
||||||
go func() {
|
go func() {
|
||||||
// this blocks
|
// this blocks
|
||||||
|
@ -80,4 +80,5 @@ func startServer() (*api.Controller, string) {
|
||||||
|
|
||||||
func stopServer(ctrl *api.Controller) {
|
func stopServer(ctrl *api.Controller) {
|
||||||
ctrl.Server.Shutdown(context.Background())
|
ctrl.Server.Shutdown(context.Background())
|
||||||
|
os.RemoveAll(ctrl.Config.Storage.RootDirectory)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue