Skip to content

Commit

Permalink
update backend tests
Browse files Browse the repository at this point in the history
Signed-off-by: pxp928 <[email protected]>
  • Loading branch information
pxp928 committed Oct 10, 2024
1 parent 4208868 commit 135f1af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 7 additions & 1 deletion internal/testing/backend/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,13 @@ func TestQueryPackagesListForScan(t *testing.T) {
t.Fatalf("did not get expected ingest error: %v", err)
}
}
got, err := b.QueryPackagesListForScan(ctx, model.PkgSpec{}, test.QueryType, test.lastScan, nil, ptrfrom.Int(10))

pkgIDsResponse, err := b.FindPackagesThatNeedScanning(ctx, model.PkgSpec{}, test.QueryType, test.lastScan)
if err != nil {
t.Fatalf("did not get expected query error: %v", err)
}

got, err := b.QueryPackagesListForScan(ctx, pkgIDsResponse, nil, ptrfrom.Int(10))
if err != nil {
t.Fatalf("did not get expected query error: %v", err)
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/assembler/backends/keyvalue/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,14 @@ func (c *demoClient) FindPackagesThatNeedScanning(ctx context.Context, pkgSpec m
}
} else {
pkgIDs = append(pkgIDs, pkgVer.ThisID)

}
}
}
}
}
}
}
return nil, nil
return pkgIDs, nil
}

func (c *demoClient) QueryPackagesListForScan(ctx context.Context, pkgIDs []string, after *string, first *int) (*model.PackageConnection, error) {
Expand Down

0 comments on commit 135f1af

Please sign in to comment.