Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose IsBlockstoreType #8752

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions esti/esti_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,9 @@ func listRepositories(t *testing.T, ctx context.Context) []apigen.Repository {
return listedRepos
}

// isBlockstoreType returns nil if the blockstore type is one of requiredTypes, or the actual
// IsBlockstoreType returns nil if the blockstore type is one of requiredTypes, or the actual
// type of the blockstore.
func isBlockstoreType(requiredTypes ...string) *string {
func IsBlockstoreType(requiredTypes ...string) *string {
blockstoreType := viper.GetString(config.BlockstoreTypeKey)
if slices.Contains(requiredTypes, blockstoreType) {
return nil
Expand All @@ -567,7 +567,7 @@ func isBlockstoreType(requiredTypes ...string) *string {

// RequireBlockstoreType Skips test if blockstore type doesn't match the required type
func RequireBlockstoreType(t testing.TB, requiredTypes ...string) {
if blockstoreType := isBlockstoreType(requiredTypes...); blockstoreType != nil {
if blockstoreType := IsBlockstoreType(requiredTypes...); blockstoreType != nil {
t.Skipf("Required blockstore types: %v, got: %s", requiredTypes, *blockstoreType)
}
}
Expand Down
2 changes: 1 addition & 1 deletion esti/multipart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestMultipartUpload(t *testing.T) {

completedParts := uploadMultipartParts(t, ctx, svc, logger, resp, parts, 0)

if isBlockstoreType(block.BlockstoreTypeS3) == nil {
if IsBlockstoreType(block.BlockstoreTypeS3) == nil {
// Object should have Last-Modified time at around time of MPU creation. Ensure
// lakeFS fails the test if it fakes it by using the current time.
time.Sleep(2 * timeResolution)
Expand Down
Loading