test(refactor): cleanup/simplify testcases (#1124)

Signed-off-by: Nicol Draghici <idraghic@cisco.com>
This commit is contained in:
Nicol
2023-01-20 20:01:52 +02:00
committed by GitHub
parent 70a60b4660
commit f0d947809b
9 changed files with 144 additions and 392 deletions
+5 -17
View File
@@ -352,10 +352,7 @@ func TestServerCVEResponseGQL(t *testing.T) {
dir := t.TempDir()
err := test.CopyFiles("../../test/data/zot-cve-test", path.Join(dir, "zot-cve-test"))
if err != nil {
panic(err)
}
test.CopyTestFiles("../../test/data/zot-cve-test", path.Join(dir, "zot-cve-test"))
conf.Storage.RootDirectory = dir
trivyConfig := &extconf.TrivyConfig{
@@ -645,10 +642,7 @@ func TestNegativeServerResponse(t *testing.T) {
dir := t.TempDir()
err := test.CopyFiles("../../test/data/zot-cve-test", path.Join(dir, "zot-cve-test"))
if err != nil {
panic(err)
}
test.CopyTestFiles("../../test/data/zot-cve-test", path.Join(dir, "zot-cve-test"))
conf.Storage.RootDirectory = dir
trivyConfig := &extconf.TrivyConfig{
@@ -731,12 +725,9 @@ func TestNegativeServerResponse(t *testing.T) {
dir := t.TempDir()
err := test.CopyFiles("../../test/data/zot-cve-test", path.Join(dir, "zot-cve-test"))
if err != nil {
panic(err)
}
test.CopyTestFiles("../../test/data/zot-cve-test", path.Join(dir, "zot-cve-test"))
err = os.RemoveAll(path.Join(dir, "zot-cve-test/blobs"))
err := os.RemoveAll(path.Join(dir, "zot-cve-test/blobs"))
if err != nil {
panic(err)
}
@@ -818,10 +809,7 @@ func TestServerCVEResponse(t *testing.T) {
dir := t.TempDir()
err := test.CopyFiles("../../test/data/zot-cve-test", path.Join(dir, "zot-cve-test"))
if err != nil {
panic(err)
}
test.CopyTestFiles("../../test/data/zot-cve-test", path.Join(dir, "zot-cve-test"))
conf.Storage.RootDirectory = dir
trivyConfig := &extconf.TrivyConfig{