Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
itaigilo committed Jan 16, 2025
1 parent af9476e commit 4e8e423
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion pkg/api/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
48 changes: 24 additions & 24 deletions pkg/catalog/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 4e8e423

Please sign in to comment.