From 8252cefb9eade16fc9e2495d340d7c8235cae644 Mon Sep 17 00:00:00 2001 From: guyhardonag Date: Tue, 4 Mar 2025 15:05:01 +0200 Subject: [PATCH] Expose IsBlockstoreType --- esti/esti_utils.go | 6 +++--- esti/multipart_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/esti/esti_utils.go b/esti/esti_utils.go index e4604d1b79c..be472d06160 100644 --- a/esti/esti_utils.go +++ b/esti/esti_utils.go @@ -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 @@ -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) } } diff --git a/esti/multipart_test.go b/esti/multipart_test.go index e96d5af06d2..c57add5e35d 100644 --- a/esti/multipart_test.go +++ b/esti/multipart_test.go @@ -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)