fix(test): update the zot tests not to use test/data as rootDir (use a temporary folder instead) (#1162)

Signed-off-by: Nicol Draghici <idraghic@cisco.com>
This commit is contained in:
Nicol
2023-02-02 21:39:03 +02:00
committed by GitHub
parent 863d057e43
commit ba3f6f7492
4 changed files with 11 additions and 24 deletions
+4 -8
View File
@@ -742,10 +742,8 @@ func TestConfigReloader(t *testing.T) {
destConfig.HTTP.Port = destPort
destDir, err := os.MkdirTemp("", "oci-dest-repo-test")
if err != nil {
panic(err)
}
// change
destDir := t.TempDir()
defer os.RemoveAll(destDir)
@@ -3928,8 +3926,7 @@ func TestSyncSignaturesDiff(t *testing.T) {
So(err, ShouldBeNil)
defer func() { _ = os.Chdir(cwd) }()
tdir, err := os.MkdirTemp("", "sigs")
So(err, ShouldBeNil)
tdir := t.TempDir()
_ = os.Chdir(tdir)
generateKeyPairs(tdir)
@@ -4021,8 +4018,7 @@ func TestSyncSignaturesDiff(t *testing.T) {
// now add new signatures to upstream and let sync detect that upstream signatures changed and pull them
So(os.RemoveAll(tdir), ShouldBeNil)
tdir, err = os.MkdirTemp("", "sigs")
So(err, ShouldBeNil)
tdir = t.TempDir()
defer os.RemoveAll(tdir)
_ = os.Chdir(tdir)
generateKeyPairs(tdir)