refactor(test): move image utils for tests in a separate module (#1789)

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
LaurentiuNiculae
2023-09-15 19:53:15 +03:00
committed by GitHub
parent 14206dd6f3
commit 8e18917b07
36 changed files with 1415 additions and 1564 deletions
+2 -1
View File
@@ -20,6 +20,7 @@ import (
"zotregistry.io/zot/pkg/storage"
"zotregistry.io/zot/pkg/storage/local"
"zotregistry.io/zot/pkg/test"
. "zotregistry.io/zot/pkg/test/image-utils"
"zotregistry.io/zot/pkg/test/mocks"
)
@@ -48,7 +49,7 @@ func TestOnUpdateManifest(t *testing.T) {
So(err, ShouldBeNil)
err = test.WriteImageToFileSystem(
test.Image{
Image{
Config: config, Manifest: manifest, Layers: layers,
}, "repo", "tag1", storeController)
So(err, ShouldBeNil)
+5 -4
View File
@@ -25,6 +25,7 @@ import (
"zotregistry.io/zot/pkg/storage/local"
storageTypes "zotregistry.io/zot/pkg/storage/types"
"zotregistry.io/zot/pkg/test"
. "zotregistry.io/zot/pkg/test/image-utils"
"zotregistry.io/zot/pkg/test/mocks"
)
@@ -411,7 +412,7 @@ func RunParseStorageTests(rootDir string, metaDB mTypes.MetaDB) {
manifests = append(manifests, manifest)
err = test.WriteImageToFileSystem(
test.Image{
Image{
Config: config,
Layers: layers,
Manifest: manifest,
@@ -432,7 +433,7 @@ func RunParseStorageTests(rootDir string, metaDB mTypes.MetaDB) {
So(err, ShouldBeNil)
err = test.WriteImageToFileSystem(
test.Image{
Image{
Config: config,
Layers: layers,
Manifest: manifest,
@@ -494,7 +495,7 @@ func RunParseStorageTests(rootDir string, metaDB mTypes.MetaDB) {
So(err, ShouldBeNil)
err = test.WriteImageToFileSystem(
test.Image{
Image{
Config: config,
Layers: layers,
Manifest: manifest,
@@ -515,7 +516,7 @@ func RunParseStorageTests(rootDir string, metaDB mTypes.MetaDB) {
So(err, ShouldBeNil)
err = test.WriteImageToFileSystem(
test.Image{
Image{
Config: config,
Layers: layers,
Manifest: manifest,