From 4e8e423d22016d6cd689b5cdd199eef3e5ae4953 Mon Sep 17 00:00:00 2001 From: Itai Gilo Date: Thu, 16 Jan 2025 09:27:10 +0000 Subject: [PATCH] Fix tests --- pkg/api/controller_test.go | 2 +- pkg/catalog/catalog_test.go | 48 ++++++++++++++++++------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pkg/api/controller_test.go b/pkg/api/controller_test.go index c09892fb6f1..f8b10b93738 100644 --- a/pkg/api/controller_test.go +++ b/pkg/api/controller_test.go @@ -101,7 +101,7 @@ func TestController_ListRepositoriesHandler(t *testing.T) { t.Run("list some repos", func(t *testing.T) { // write some repos ctx := context.Background() - _, err := deps.catalog.CreateRepository(ctx, "foo1", "storage", onBlock(deps, "foo1"), "main", false) + _, err := deps.catalog.CreateRepository(ctx, "foo1", "", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) _, err = deps.catalog.CreateRepository(ctx, "foo2", "storage", onBlock(deps, "foo1"), "main", false) testutil.Must(t, err) diff --git a/pkg/catalog/catalog_test.go b/pkg/catalog/catalog_test.go index 5ac6daa6ca1..9aad74cd31d 100644 --- a/pkg/catalog/catalog_test.go +++ b/pkg/catalog/catalog_test.go @@ -73,11 +73,11 @@ func TestCatalog_ListRepositories(t *testing.T) { now := time.Now() gravelerData := []*graveler.RepositoryRecord{ {RepositoryID: "re", Repository: &graveler.Repository{StorageID: "storage", StorageNamespace: "storageNS1", CreationDate: now, DefaultBranchID: "main1"}}, - {RepositoryID: "repo1", Repository: &graveler.Repository{StorageID: "storage", StorageNamespace: "storageNS2", CreationDate: now, DefaultBranchID: "main2"}}, - {RepositoryID: "repo2", Repository: &graveler.Repository{StorageID: "storage", StorageNamespace: "storageNS3", CreationDate: now, DefaultBranchID: "main3"}}, - {RepositoryID: "repo22", Repository: &graveler.Repository{StorageID: "storage", StorageNamespace: "storageNS4", CreationDate: now, DefaultBranchID: "main4"}}, - {RepositoryID: "repo23", Repository: &graveler.Repository{StorageID: "storage", StorageNamespace: "storageNS5", CreationDate: now, DefaultBranchID: "main5"}}, - {RepositoryID: "repo3", Repository: &graveler.Repository{StorageID: "storage", StorageNamespace: "storageNS6", CreationDate: now, DefaultBranchID: "main6"}}, + {RepositoryID: "repo1", Repository: &graveler.Repository{StorageID: "storage1", StorageNamespace: "storageNS2", CreationDate: now, DefaultBranchID: "main2"}}, + {RepositoryID: "repo2", Repository: &graveler.Repository{StorageID: "storage1", StorageNamespace: "storageNS3", CreationDate: now, DefaultBranchID: "main3"}}, + {RepositoryID: "repo22", Repository: &graveler.Repository{StorageID: "storage1", StorageNamespace: "storageNS4", CreationDate: now, DefaultBranchID: "main4"}}, + {RepositoryID: "repo23", Repository: &graveler.Repository{StorageID: "storage1", StorageNamespace: "storageNS5", CreationDate: now, DefaultBranchID: "main5"}}, + {RepositoryID: "repo3", Repository: &graveler.Repository{StorageID: "storage2", StorageNamespace: "storageNS6", CreationDate: now, DefaultBranchID: "main6"}}, } type args struct { limit int @@ -102,11 +102,11 @@ func TestCatalog_ListRepositories(t *testing.T) { }, want: []*catalog.Repository{ {Name: "re", StorageID: "storage", StorageNamespace: "storageNS1", DefaultBranch: "main1", CreationDate: now}, - {Name: "repo1", StorageID: "storage", StorageNamespace: "storageNS2", DefaultBranch: "main2", CreationDate: now}, - {Name: "repo2", StorageID: "storage", StorageNamespace: "storageNS3", DefaultBranch: "main3", CreationDate: now}, - {Name: "repo22", StorageID: "storage", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, - {Name: "repo23", StorageID: "storage", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, - {Name: "repo3", StorageID: "storage", StorageNamespace: "storageNS6", DefaultBranch: "main6", CreationDate: now}, + {Name: "repo1", StorageID: "storage1", StorageNamespace: "storageNS2", DefaultBranch: "main2", CreationDate: now}, + {Name: "repo2", StorageID: "storage1", StorageNamespace: "storageNS3", DefaultBranch: "main3", CreationDate: now}, + {Name: "repo22", StorageID: "storage1", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, + {Name: "repo23", StorageID: "storage1", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, + {Name: "repo3", StorageID: "storage2", StorageNamespace: "storageNS6", DefaultBranch: "main6", CreationDate: now}, }, wantHasMore: false, wantErr: false, @@ -134,7 +134,7 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "", }, want: []*catalog.Repository{ - {Name: "repo1", StorageID: "storage", StorageNamespace: "storageNS2", DefaultBranch: "main2", CreationDate: now}, + {Name: "repo1", StorageID: "storage1", StorageNamespace: "storageNS2", DefaultBranch: "main2", CreationDate: now}, }, wantHasMore: true, wantErr: false, @@ -148,8 +148,8 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "", }, want: []*catalog.Repository{ - {Name: "repo2", StorageID: "storage", StorageNamespace: "storageNS3", DefaultBranch: "main3", CreationDate: now}, - {Name: "repo22", StorageID: "storage", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, + {Name: "repo2", StorageID: "storage1", StorageNamespace: "storageNS3", DefaultBranch: "main3", CreationDate: now}, + {Name: "repo22", StorageID: "storage1", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, }, wantHasMore: true, wantErr: false, @@ -163,7 +163,7 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "", }, want: []*catalog.Repository{ - {Name: "repo1", StorageID: "storage", StorageNamespace: "storageNS2", DefaultBranch: "main2", CreationDate: now}, + {Name: "repo1", StorageID: "storage1", StorageNamespace: "storageNS2", DefaultBranch: "main2", CreationDate: now}, }, wantHasMore: true, wantErr: false, @@ -177,8 +177,8 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "", }, want: []*catalog.Repository{ - {Name: "repo23", StorageID: "storage", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, - {Name: "repo3", StorageID: "storage", StorageNamespace: "storageNS6", DefaultBranch: "main6", CreationDate: now}, + {Name: "repo23", StorageID: "storage1", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, + {Name: "repo3", StorageID: "storage2", StorageNamespace: "storageNS6", DefaultBranch: "main6", CreationDate: now}, }, wantHasMore: false, wantErr: false, @@ -192,9 +192,9 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "o2", }, want: []*catalog.Repository{ - {Name: "repo2", StorageID: "storage", StorageNamespace: "storageNS3", DefaultBranch: "main3", CreationDate: now}, - {Name: "repo22", StorageID: "storage", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, - {Name: "repo23", StorageID: "storage", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, + {Name: "repo2", StorageID: "storage1", StorageNamespace: "storageNS3", DefaultBranch: "main3", CreationDate: now}, + {Name: "repo22", StorageID: "storage1", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, + {Name: "repo23", StorageID: "storage1", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, }, wantHasMore: false, wantErr: false, @@ -208,8 +208,8 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "o2", }, want: []*catalog.Repository{ - {Name: "repo2", StorageID: "storage", StorageNamespace: "storageNS3", DefaultBranch: "main3", CreationDate: now}, - {Name: "repo22", StorageID: "storage", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, + {Name: "repo2", StorageID: "storage1", StorageNamespace: "storageNS3", DefaultBranch: "main3", CreationDate: now}, + {Name: "repo22", StorageID: "storage1", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, }, wantHasMore: true, wantErr: false, @@ -223,7 +223,7 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "o2", }, want: []*catalog.Repository{ - {Name: "repo23", StorageID: "storage", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, + {Name: "repo23", StorageID: "storage1", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, }, wantHasMore: false, wantErr: false, @@ -237,8 +237,8 @@ func TestCatalog_ListRepositories(t *testing.T) { searchString: "o2", }, want: []*catalog.Repository{ - {Name: "repo22", StorageID: "storage", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, - {Name: "repo23", StorageID: "storage", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, + {Name: "repo22", StorageID: "storage1", StorageNamespace: "storageNS4", DefaultBranch: "main4", CreationDate: now}, + {Name: "repo23", StorageID: "storage1", StorageNamespace: "storageNS5", DefaultBranch: "main5", CreationDate: now}, }, wantHasMore: false, wantErr: false,