From 9c152f349e82cb2ec6ac31d5a82a3bd7346ff0fe Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Thu, 13 Nov 2025 14:40:48 -0500 Subject: [PATCH 1/6] Do not provide storage URIs in 3.0 REST requests. --- test/src/unit-capi-array.cc | 53 ++++-- test/src/unit-capi-consolidation.cc | 250 +++++++++++++++++++-------- test/support/src/vfs_helpers.h | 37 ++++ tiledb/sm/rest/rest_client_remote.cc | 5 +- tiledb/sm/serialization/group.cc | 4 + 5 files changed, 265 insertions(+), 84 deletions(-) diff --git a/test/src/unit-capi-array.cc b/test/src/unit-capi-array.cc index 88e53831c8d..35081017cd6 100644 --- a/test/src/unit-capi-array.cc +++ b/test/src/unit-capi-array.cc @@ -39,6 +39,7 @@ #include "test/support/src/helpers.h" #include "test/support/src/serialization_wrappers.h" #include "test/support/src/vfs_helpers.h" +#include "tiledb/api/c_api/vfs/vfs_api_internal.h" #ifdef _WIN32 #include "tiledb/sm/filesystem/win.h" #else @@ -96,15 +97,19 @@ struct ArrayFx { tiledb_encryption_type_t encryption_type_ = TILEDB_NO_ENCRYPTION; const char* encryption_key_ = nullptr; + // TODO: Update ArrayFx to use VFSTestSetup. + const char* default_bucket_ = "s3://default-bucket"; + // Functions ArrayFx(); ~ArrayFx(); void create_temp_dir(const std::string& path); void remove_temp_dir(const std::string& path); - void create_sparse_vector(const std::string& path); - void create_sparse_array(const std::string& path); - void create_dense_vector(const std::string& path); - void create_dense_array(const std::string& path); + std::string get_array_path(URI creation_uri); + std::string create_sparse_vector(const std::string& path); + std::string create_sparse_array(const std::string& path); + std::string create_dense_vector(const std::string& path); + std::string create_dense_array(const std::string& path); void write_fragment(tiledb_array_t* array, uint64_t timestamp); static int get_fragment_timestamps(const char* path, void* data); }; @@ -123,6 +128,17 @@ ArrayFx::ArrayFx() } ArrayFx::~ArrayFx() { + if (fs_vec_[0]->is_rest()) { + int32_t is_empty = 0; + REQUIRE( + tiledb_vfs_is_empty_bucket(ctx_, vfs_, default_bucket_, &is_empty) == + TILEDB_OK); + if (!is_empty) { + REQUIRE( + tiledb_vfs_empty_bucket(ctx_, vfs_, default_bucket_) == TILEDB_OK); + } + } + // Close vfs test REQUIRE(vfs_test_close(fs_vec_, ctx_, vfs_).ok()); tiledb_vfs_free(&vfs_); @@ -152,7 +168,16 @@ int ArrayFx::get_fragment_timestamps(const char* path, void* data) { return 1; } -void ArrayFx::create_sparse_vector(const std::string& path) { +std::string ArrayFx::get_array_path(URI creation_uri) { + if (!creation_uri.is_tiledb()) { + return creation_uri.to_string(); + } + std::vector uris; + REQUIRE(vfs_->ls(URI(default_bucket_), &uris).ok()); + return uris.back().to_string(); +} + +std::string ArrayFx::create_sparse_vector(const std::string& path) { int rc; int64_t dim_domain[] = {-1, 2}; int64_t tile_extent = 2; @@ -196,9 +221,11 @@ void ArrayFx::create_sparse_vector(const std::string& path) { tiledb_dimension_free(&dim); tiledb_domain_free(&domain); tiledb_array_schema_free(&array_schema); + + return get_array_path(URI(path)); } -void ArrayFx::create_sparse_array(const std::string& path) { +std::string ArrayFx::create_sparse_array(const std::string& path) { int rc; int64_t dim_domain[] = {1, 10, 1, 10}; int64_t tile_extent = 2; @@ -249,9 +276,11 @@ void ArrayFx::create_sparse_array(const std::string& path) { tiledb_dimension_free(&dim_2); tiledb_domain_free(&domain); tiledb_array_schema_free(&array_schema); + + return get_array_path(URI(path)); } -void ArrayFx::create_dense_vector(const std::string& path) { +std::string ArrayFx::create_dense_vector(const std::string& path) { int rc; int64_t dim_domain[] = {1, 10}; int64_t tile_extent = 2; @@ -314,9 +343,11 @@ void ArrayFx::create_dense_vector(const std::string& path) { tiledb_dimension_free(&dim); tiledb_domain_free(&domain); tiledb_array_schema_free(&array_schema); + + return get_array_path(URI(path)); } -void ArrayFx::create_dense_array(const std::string& path) { +std::string ArrayFx::create_dense_array(const std::string& path) { int rc; int64_t dim_domain[] = {1, 10, 1, 10}; int64_t tile_extent = 2; @@ -367,6 +398,8 @@ void ArrayFx::create_dense_array(const std::string& path) { tiledb_dimension_free(&dim_2); tiledb_domain_free(&domain); tiledb_array_schema_free(&array_schema); + + return get_array_path(URI(path)); } void ArrayFx::write_fragment(tiledb_array_t* array, uint64_t timestamp) { @@ -900,7 +933,7 @@ TEST_CASE_METHOD( create_temp_dir(temp_dir); - create_dense_vector(array_name); + array_path = create_dense_vector(array_name); // ---- FIRST WRITE ---- // Prepare cell buffers @@ -1933,7 +1966,7 @@ TEST_CASE_METHOD( create_temp_dir(temp_dir); - create_dense_vector(array_name); + array_path = create_dense_vector(array_name); // Conditionally consolidate // Note: there's no need to vacuum; delete_array will delete all fragments diff --git a/test/src/unit-capi-consolidation.cc b/test/src/unit-capi-consolidation.cc index 0108a81b056..f44a9f28d66 100644 --- a/test/src/unit-capi-consolidation.cc +++ b/test/src/unit-capi-consolidation.cc @@ -55,18 +55,10 @@ struct ConsolidationFx { tiledb_vfs_t* vfs_; std::string dense_vector_uri_; - std::string dense_vector_frag_dir_; - std::string dense_vector_frag_meta_dir_; std::string dense_array_uri_; - std::string dense_array_commits_dir_; - std::string dense_array_frag_dir_; std::string sparse_array_uri_; - std::string sparse_array_commits_dir_; - std::string sparse_array_frag_dir_; std::string sparse_heterogeneous_array_uri_; std::string sparse_string_array_uri_; - std::string sparse_string_array_fragment_dir_; - std::string sparse_string_array_frag_meta_dir_; // Encryption parameters tiledb_encryption_type_t encryption_type_ = TILEDB_NO_ENCRYPTION; @@ -178,30 +170,14 @@ ConsolidationFx::ConsolidationFx() , vfs_(vfs_test_setup_.vfs_c) , dense_vector_uri_( vfs_test_setup_.array_uri("test_consolidate_dense_vector")) - , dense_vector_frag_dir_(vfs_test_setup_.array_uri( - "test_consolidate_dense_vector/__fragments", true)) - , dense_vector_frag_meta_dir_(vfs_test_setup_.array_uri( - "test_consolidate_dense_vector/__fragment_meta", true)) , dense_array_uri_( vfs_test_setup_.array_uri("test_consolidate_dense_array")) - , dense_array_commits_dir_(vfs_test_setup_.array_uri( - "test_consolidate_dense_array/__commits", true)) - , dense_array_frag_dir_(vfs_test_setup_.array_uri( - "test_consolidate_dense_array/__fragments", true)) , sparse_array_uri_( vfs_test_setup_.array_uri("test_consolidate_sparse_array")) - , sparse_array_commits_dir_(vfs_test_setup_.array_uri( - "test_consolidate_sparse_array/__commits", true)) - , sparse_array_frag_dir_(vfs_test_setup_.array_uri( - "test_consolidate_sparse_array/__fragments", true)) , sparse_heterogeneous_array_uri_(vfs_test_setup_.array_uri( "test_consolidate_sparse_heterogeneous_array")) , sparse_string_array_uri_(vfs_test_setup_.array_uri( - "test_consolidate_sparse_string_array", true)) - , sparse_string_array_fragment_dir_(vfs_test_setup_.array_uri( - "test_consolidate_sparse_string_array/__fragments", true)) - , sparse_string_array_frag_meta_dir_(vfs_test_setup_.array_uri( - "test_consolidate_sparse_string_array/__fragment_meta", true)) { + "test_consolidate_sparse_string_array", true)) { } void ConsolidationFx::create_dense_vector() { @@ -4699,9 +4675,9 @@ void ConsolidationFx::check_commits_dir( int32_t rc; get_num_struct data; - std::string array_commits_uri = dense_array_commits_dir_; + std::string array_commits_uri = vfs_test_setup_.commits_dir(dense_array_uri_); if (!dense) { - array_commits_uri = sparse_array_commits_dir_; + array_commits_uri = vfs_test_setup_.commits_dir(sparse_array_uri_); } // Check number of consolidated commits files @@ -5079,7 +5055,11 @@ TEST_CASE_METHOD( // Check that there are 4 fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_array_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 4); @@ -5138,7 +5118,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 3); @@ -5197,7 +5181,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 2); @@ -5256,7 +5244,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 4); @@ -5315,7 +5307,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 3); @@ -5374,7 +5370,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 2); @@ -5433,7 +5433,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 1); @@ -5492,7 +5496,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 2); @@ -5551,7 +5559,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 1); @@ -5613,7 +5625,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 3); @@ -5680,7 +5696,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 3); @@ -5736,7 +5756,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 2); @@ -5803,7 +5827,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 2); @@ -5862,7 +5890,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 4); @@ -5923,7 +5955,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 2); @@ -5985,7 +6021,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 1); @@ -6043,7 +6083,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 2); @@ -6104,7 +6148,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 3); @@ -6178,7 +6226,11 @@ TEST_CASE_METHOD( get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == ((should_consolidate) ? 3 : 2)); @@ -6192,7 +6244,11 @@ TEST_CASE_METHOD( // Check number of fragments data.num = 0; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == ((should_consolidate) ? 1 : 2)); @@ -6227,14 +6283,22 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 5); // Check number of consolidated metadata files data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_meta_dir_.c_str(), &get_meta_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_metadata_dir(dense_vector_uri_).c_str(), + &get_meta_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 0); @@ -6328,14 +6392,22 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 4); // Check number of consolidated metadata files data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_meta_dir_.c_str(), &get_meta_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_metadata_dir(dense_vector_uri_).c_str(), + &get_meta_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 1); @@ -6350,7 +6422,11 @@ TEST_CASE_METHOD( // Check data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 8); @@ -6370,7 +6446,11 @@ TEST_CASE_METHOD( // Check number of consolidated metadata files data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_meta_dir_.c_str(), &get_meta_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_metadata_dir(dense_vector_uri_).c_str(), + &get_meta_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 2); @@ -6383,7 +6463,11 @@ TEST_CASE_METHOD( // Check data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 8); read_dense_vector(1); @@ -6413,7 +6497,11 @@ TEST_CASE_METHOD( // Check number of consolidated metadata files data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_vector_frag_meta_dir_.c_str(), &get_meta_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_metadata_dir(dense_vector_uri_).c_str(), + &get_meta_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 1); @@ -6539,7 +6627,7 @@ TEST_CASE_METHOD( rc = tiledb_vfs_ls( ctx_, vfs_, - sparse_string_array_fragment_dir_.c_str(), + vfs_test_setup_.fragment_dir(sparse_string_array_uri_).c_str(), &get_dir_num, &data); CHECK(rc == TILEDB_OK); @@ -6550,7 +6638,7 @@ TEST_CASE_METHOD( rc = tiledb_vfs_ls( ctx_, vfs_, - sparse_string_array_frag_meta_dir_.c_str(), + vfs_test_setup_.fragment_metadata_dir(sparse_string_array_uri_).c_str(), &get_meta_num, &data); CHECK(rc == TILEDB_OK); @@ -6571,7 +6659,7 @@ TEST_CASE_METHOD( rc = tiledb_vfs_ls( ctx_, vfs_, - sparse_string_array_frag_meta_dir_.c_str(), + vfs_test_setup_.fragment_metadata_dir(sparse_string_array_uri_).c_str(), &get_meta_num, &data); CHECK(rc == TILEDB_OK); @@ -6621,7 +6709,7 @@ TEST_CASE_METHOD( rc = tiledb_vfs_ls( ctx_, vfs_, - sparse_string_array_fragment_dir_.c_str(), + vfs_test_setup_.fragment_dir(sparse_string_array_uri_).c_str(), &get_dir_num, &data); CHECK(rc == TILEDB_OK); @@ -6632,7 +6720,7 @@ TEST_CASE_METHOD( rc = tiledb_vfs_ls( ctx_, vfs_, - sparse_string_array_frag_meta_dir_.c_str(), + vfs_test_setup_.fragment_metadata_dir(sparse_string_array_uri_).c_str(), &get_meta_num, &data); CHECK(rc == TILEDB_OK); @@ -6658,7 +6746,7 @@ TEST_CASE_METHOD( rc = tiledb_vfs_ls( ctx_, vfs_, - sparse_string_array_frag_meta_dir_.c_str(), + vfs_test_setup_.fragment_metadata_dir(sparse_string_array_uri_).c_str(), &get_meta_num, &data); CHECK(rc == TILEDB_OK); @@ -7223,7 +7311,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_array_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_array_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 5); @@ -7238,7 +7330,11 @@ TEST_CASE_METHOD( // Check number of fragments data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, dense_array_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(dense_array_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 3); @@ -7318,7 +7414,11 @@ TEST_CASE_METHOD( // Check number of fragments get_num_struct data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, sparse_array_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(sparse_array_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 5); @@ -7333,7 +7433,11 @@ TEST_CASE_METHOD( // Check number of fragments data = {ctx_, vfs_, 0}; rc = tiledb_vfs_ls( - ctx_, vfs_, sparse_array_frag_dir_.c_str(), &get_dir_num, &data); + ctx_, + vfs_, + vfs_test_setup_.fragment_dir(sparse_array_uri_).c_str(), + &get_dir_num, + &data); CHECK(rc == TILEDB_OK); CHECK(data.num == 3); @@ -7545,12 +7649,12 @@ TEST_CASE_METHOD( SECTION("- sparse array") { dense_test = false; array_uri = sparse_array_uri_; - commits_uri = sparse_array_commits_dir_; + commits_uri = vfs_test_setup_.commits_dir(sparse_array_uri_); } SECTION("- dense array") { dense_test = true; array_uri = dense_array_uri_; - commits_uri = dense_array_commits_dir_; + commits_uri = vfs_test_setup_.commits_dir(dense_array_uri_); } if (dense_test) { @@ -7645,12 +7749,12 @@ TEST_CASE_METHOD( SECTION("- sparse array") { dense_test = false; array_uri = sparse_array_uri_; - commits_uri = sparse_array_commits_dir_; + commits_uri = vfs_test_setup_.commits_dir(sparse_array_uri_); } SECTION("- dense array") { dense_test = true; array_uri = dense_array_uri_; - commits_uri = dense_array_commits_dir_; + commits_uri = vfs_test_setup_.commits_dir(dense_array_uri_); } if (dense_test) { @@ -7724,12 +7828,12 @@ TEST_CASE_METHOD( SECTION("- sparse array") { dense_test = false; array_uri = sparse_array_uri_; - commits_uri = sparse_array_commits_dir_; + commits_uri = vfs_test_setup_.commits_dir(sparse_array_uri_); } SECTION("- dense array") { dense_test = true; array_uri = dense_array_uri_; - commits_uri = dense_array_commits_dir_; + commits_uri = vfs_test_setup_.commits_dir(dense_array_uri_); } if (dense_test) { @@ -7807,12 +7911,12 @@ TEST_CASE_METHOD( SECTION("- sparse array") { dense_test = false; array_uri = sparse_array_uri_; - commits_uri = sparse_array_commits_dir_; + commits_uri = vfs_test_setup_.commits_dir(sparse_array_uri_); } SECTION("- dense array") { dense_test = true; array_uri = dense_array_uri_; - commits_uri = dense_array_commits_dir_; + commits_uri = vfs_test_setup_.commits_dir(dense_array_uri_); } if (dense_test) { diff --git a/test/support/src/vfs_helpers.h b/test/support/src/vfs_helpers.h index 7983904c53a..d1892cb505b 100644 --- a/test/support/src/vfs_helpers.h +++ b/test/support/src/vfs_helpers.h @@ -36,6 +36,7 @@ #include #include #include "test/support/src/helpers.h" +#include "tiledb/api/c_api/vfs/vfs_api_internal.h" #include "tiledb/sm/enums/vfs_mode.h" #include "tiledb/sm/filesystem/vfs.h" @@ -905,6 +906,42 @@ struct VFSTestSetup { return Context(ctx_c, false); } + /** + * TileDB-Server does not support custom storage locations for array or group + * creation, default storage configuration should be used instead. Default + * storage in TileDB-Server will generate a group or array UUID to use as the + * prefix for create the asset within the default bucket. + * + * This helper fetches the backend location REST generated for the new asset + * during creation. + * + * @param creation_uri The URI passed to array / group create request. + * @return The backend storage location for the created array / group. + */ + std::string get_rest_array_uri(const std::string& creation_uri) const { + if (!sm::URI(creation_uri).is_tiledb()) { + return creation_uri; + } + std::vector uris; + REQUIRE(vfs_c->ls(sm::URI(default_storage()), &uris).ok()); + return uris.back().to_string(); + } + + std::string fragment_dir(const std::string& uri) const { + sm::URI backend_uri(get_rest_array_uri(uri)); + return backend_uri.join_path("__fragments").to_string(); + } + + std::string fragment_metadata_dir(const std::string& uri) const { + sm::URI backend_uri(get_rest_array_uri(uri)); + return backend_uri.join_path("__fragment_meta").to_string(); + } + + std::string commits_dir(const std::string& uri) const { + sm::URI backend_uri(get_rest_array_uri(uri)); + return backend_uri.join_path("__commits").to_string(); + } + ~VFSTestSetup() { vfs_test_remove_temp_dir(ctx_c, vfs_c, temp_dir); vfs_test_close(fs_vec, ctx_c, vfs_c).ok(); diff --git a/tiledb/sm/rest/rest_client_remote.cc b/tiledb/sm/rest/rest_client_remote.cc index 61d31e5a49c..fd922c91b8c 100644 --- a/tiledb/sm/rest/rest_client_remote.cc +++ b/tiledb/sm/rest/rest_client_remote.cc @@ -335,7 +335,10 @@ void RestClientRemote::post_array_create_to_rest( URI::RESTURIComponents rest_uri; throw_if_not_ok(uri.get_rest_components(rest_legacy(), &rest_uri)); serialization::array_create_serialize( - array_schema, serialization_type_, buff, {rest_uri.asset_storage}); + array_schema, + serialization_type_, + buff, + {rest_legacy() ? rest_uri.asset_storage : ""}); const auto creation_access_credentials_name{ config_->get("rest.creation_access_credentials_name")}; diff --git a/tiledb/sm/serialization/group.cc b/tiledb/sm/serialization/group.cc index 43ad8bb4f2e..3cb8928d2f7 100644 --- a/tiledb/sm/serialization/group.cc +++ b/tiledb/sm/serialization/group.cc @@ -331,6 +331,10 @@ Status group_create_details_to_capnp( return LOG_STATUS( Status_SerializationError("Error serializing group; group is null.")); } + if (!legacy) { + // TileDB-Server requests do not support custom storage locations. + return Status::Ok(); + } const auto& group_uri = group->group_uri(); if (group_uri.is_tiledb()) { From f8dd6d24144f67438b4e11cbf0bf131dcc5f9461 Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Thu, 13 Nov 2025 16:40:03 -0500 Subject: [PATCH 2/6] Fix failing TileDB-Server test. --- test/support/src/vfs_helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/support/src/vfs_helpers.h b/test/support/src/vfs_helpers.h index d1892cb505b..c82e9573143 100644 --- a/test/support/src/vfs_helpers.h +++ b/test/support/src/vfs_helpers.h @@ -837,7 +837,7 @@ struct VFSTestSetup { tiledb_vfs_is_bucket(ctx_c, vfs_c, default_storage().c_str(), &is_bucket); if (!is_bucket) { tiledb_vfs_create_bucket(ctx_c, vfs_c, default_storage().c_str()); - } else { + } else if (remove_tmpdir) { tiledb_vfs_empty_bucket(ctx_c, vfs_c, default_storage().c_str()); } }; From f11c665dd1eacd18196eb5dc2cc3ffbc74649eda Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Thu, 13 Nov 2025 17:48:19 -0500 Subject: [PATCH 3/6] Fix failing legacy test. --- test/src/unit-capi-array.cc | 43 ++++++++++++++++----------------- test/support/src/vfs_helpers.cc | 2 +- test/support/src/vfs_helpers.h | 8 ++++-- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/test/src/unit-capi-array.cc b/test/src/unit-capi-array.cc index 35081017cd6..92d43b60b9a 100644 --- a/test/src/unit-capi-array.cc +++ b/test/src/unit-capi-array.cc @@ -105,11 +105,11 @@ struct ArrayFx { ~ArrayFx(); void create_temp_dir(const std::string& path); void remove_temp_dir(const std::string& path); - std::string get_array_path(URI creation_uri); - std::string create_sparse_vector(const std::string& path); - std::string create_sparse_array(const std::string& path); - std::string create_dense_vector(const std::string& path); - std::string create_dense_array(const std::string& path); + std::string get_array_path(const std::string& creation_uri) const; + void create_sparse_vector(const std::string& path); + void create_sparse_array(const std::string& path); + void create_dense_vector(const std::string& path); + void create_dense_array(const std::string& path); void write_fragment(tiledb_array_t* array, uint64_t timestamp); static int get_fragment_timestamps(const char* path, void* data); }; @@ -168,16 +168,21 @@ int ArrayFx::get_fragment_timestamps(const char* path, void* data) { return 1; } -std::string ArrayFx::get_array_path(URI creation_uri) { - if (!creation_uri.is_tiledb()) { - return creation_uri.to_string(); +std::string ArrayFx::get_array_path(const std::string& creation_uri) const { + if ((ctx_->has_rest_client() && ctx_->rest_client().rest_legacy()) || + !URI(creation_uri).is_tiledb()) { + const std::string prefix = "tiledb://unit/"; + if (creation_uri.starts_with(prefix)) { + return creation_uri.substr(prefix.length()); + } + return creation_uri; } std::vector uris; REQUIRE(vfs_->ls(URI(default_bucket_), &uris).ok()); return uris.back().to_string(); } -std::string ArrayFx::create_sparse_vector(const std::string& path) { +void ArrayFx::create_sparse_vector(const std::string& path) { int rc; int64_t dim_domain[] = {-1, 2}; int64_t tile_extent = 2; @@ -221,11 +226,9 @@ std::string ArrayFx::create_sparse_vector(const std::string& path) { tiledb_dimension_free(&dim); tiledb_domain_free(&domain); tiledb_array_schema_free(&array_schema); - - return get_array_path(URI(path)); } -std::string ArrayFx::create_sparse_array(const std::string& path) { +void ArrayFx::create_sparse_array(const std::string& path) { int rc; int64_t dim_domain[] = {1, 10, 1, 10}; int64_t tile_extent = 2; @@ -276,11 +279,9 @@ std::string ArrayFx::create_sparse_array(const std::string& path) { tiledb_dimension_free(&dim_2); tiledb_domain_free(&domain); tiledb_array_schema_free(&array_schema); - - return get_array_path(URI(path)); } -std::string ArrayFx::create_dense_vector(const std::string& path) { +void ArrayFx::create_dense_vector(const std::string& path) { int rc; int64_t dim_domain[] = {1, 10}; int64_t tile_extent = 2; @@ -343,11 +344,9 @@ std::string ArrayFx::create_dense_vector(const std::string& path) { tiledb_dimension_free(&dim); tiledb_domain_free(&domain); tiledb_array_schema_free(&array_schema); - - return get_array_path(URI(path)); } -std::string ArrayFx::create_dense_array(const std::string& path) { +void ArrayFx::create_dense_array(const std::string& path) { int rc; int64_t dim_domain[] = {1, 10, 1, 10}; int64_t tile_extent = 2; @@ -398,8 +397,6 @@ std::string ArrayFx::create_dense_array(const std::string& path) { tiledb_dimension_free(&dim_2); tiledb_domain_free(&domain); tiledb_array_schema_free(&array_schema); - - return get_array_path(URI(path)); } void ArrayFx::write_fragment(tiledb_array_t* array, uint64_t timestamp) { @@ -933,7 +930,8 @@ TEST_CASE_METHOD( create_temp_dir(temp_dir); - array_path = create_dense_vector(array_name); + create_dense_vector(array_name); + array_path = get_array_path(array_path); // ---- FIRST WRITE ---- // Prepare cell buffers @@ -1966,7 +1964,8 @@ TEST_CASE_METHOD( create_temp_dir(temp_dir); - array_path = create_dense_vector(array_name); + create_dense_vector(array_name); + array_path = get_array_path(array_path); // Conditionally consolidate // Note: there's no need to vacuum; delete_array will delete all fragments diff --git a/test/support/src/vfs_helpers.cc b/test/support/src/vfs_helpers.cc index b98c7331daf..4497110c117 100644 --- a/test/support/src/vfs_helpers.cc +++ b/test/support/src/vfs_helpers.cc @@ -570,7 +570,7 @@ LocalFsTest::LocalFsTest(const std::vector& test_tree) std::sort(expected_results_.begin(), expected_results_.end()); } -bool VFSTestSetup::is_legacy_rest() { +bool VFSTestSetup::is_legacy_rest() const { return is_rest() && ctx_c->rest_client().rest_legacy(); } diff --git a/test/support/src/vfs_helpers.h b/test/support/src/vfs_helpers.h index c82e9573143..c6f8aced4fd 100644 --- a/test/support/src/vfs_helpers.h +++ b/test/support/src/vfs_helpers.h @@ -856,7 +856,7 @@ struct VFSTestSetup { return fs_vec[0]->is_rest(); } - bool is_legacy_rest(); + bool is_legacy_rest() const; bool is_local() const { return fs_vec[0]->is_local(); @@ -919,7 +919,11 @@ struct VFSTestSetup { * @return The backend storage location for the created array / group. */ std::string get_rest_array_uri(const std::string& creation_uri) const { - if (!sm::URI(creation_uri).is_tiledb()) { + if (is_legacy_rest() || !sm::URI(creation_uri).is_tiledb()) { + const std::string prefix = "tiledb://unit/"; + if (creation_uri.starts_with(prefix)) { + return creation_uri.substr(prefix.length()); + } return creation_uri; } std::vector uris; From d74db8b13415091664c43c9acc4c4a8a0bc80afd Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Fri, 14 Nov 2025 10:58:02 -0500 Subject: [PATCH 4/6] Fix tests. --- test/src/unit-capi-array.cc | 15 +++++++++------ test/src/unit-capi-consolidation.cc | 2 +- test/support/src/vfs_helpers.h | 9 ++++++--- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/test/src/unit-capi-array.cc b/test/src/unit-capi-array.cc index 92d43b60b9a..9970450ef32 100644 --- a/test/src/unit-capi-array.cc +++ b/test/src/unit-capi-array.cc @@ -105,7 +105,8 @@ struct ArrayFx { ~ArrayFx(); void create_temp_dir(const std::string& path); void remove_temp_dir(const std::string& path); - std::string get_array_path(const std::string& creation_uri) const; + std::string get_array_path( + const std::string& creation_uri, bool legacy_rest) const; void create_sparse_vector(const std::string& path); void create_sparse_array(const std::string& path); void create_dense_vector(const std::string& path); @@ -168,9 +169,9 @@ int ArrayFx::get_fragment_timestamps(const char* path, void* data) { return 1; } -std::string ArrayFx::get_array_path(const std::string& creation_uri) const { - if ((ctx_->has_rest_client() && ctx_->rest_client().rest_legacy()) || - !URI(creation_uri).is_tiledb()) { +std::string ArrayFx::get_array_path( + const std::string& creation_uri, bool legacy_rest) const { + if (legacy_rest || !URI(creation_uri).is_tiledb()) { const std::string prefix = "tiledb://unit/"; if (creation_uri.starts_with(prefix)) { return creation_uri.substr(prefix.length()); @@ -931,7 +932,8 @@ TEST_CASE_METHOD( create_temp_dir(temp_dir); create_dense_vector(array_name); - array_path = get_array_path(array_path); + array_path = get_array_path( + array_name, fs_vec_[0]->is_rest() && ctx_->rest_client().rest_legacy()); // ---- FIRST WRITE ---- // Prepare cell buffers @@ -1965,7 +1967,8 @@ TEST_CASE_METHOD( create_temp_dir(temp_dir); create_dense_vector(array_name); - array_path = get_array_path(array_path); + array_path = get_array_path( + array_name, fs_vec_[0]->is_rest() && ctx_->rest_client().rest_legacy()); // Conditionally consolidate // Note: there's no need to vacuum; delete_array will delete all fragments diff --git a/test/src/unit-capi-consolidation.cc b/test/src/unit-capi-consolidation.cc index f44a9f28d66..e1907946285 100644 --- a/test/src/unit-capi-consolidation.cc +++ b/test/src/unit-capi-consolidation.cc @@ -5057,7 +5057,7 @@ TEST_CASE_METHOD( rc = tiledb_vfs_ls( ctx_, vfs_, - vfs_test_setup_.fragment_dir(dense_array_uri_).c_str(), + vfs_test_setup_.fragment_dir(dense_vector_uri_).c_str(), &get_dir_num, &data); CHECK(rc == TILEDB_OK); diff --git a/test/support/src/vfs_helpers.h b/test/support/src/vfs_helpers.h index c6f8aced4fd..70c6f8bdcf3 100644 --- a/test/support/src/vfs_helpers.h +++ b/test/support/src/vfs_helpers.h @@ -933,17 +933,20 @@ struct VFSTestSetup { std::string fragment_dir(const std::string& uri) const { sm::URI backend_uri(get_rest_array_uri(uri)); - return backend_uri.join_path("__fragments").to_string(); + return backend_uri.join_path(sm::constants::array_fragments_dir_name) + .to_string(); } std::string fragment_metadata_dir(const std::string& uri) const { sm::URI backend_uri(get_rest_array_uri(uri)); - return backend_uri.join_path("__fragment_meta").to_string(); + return backend_uri.join_path(sm::constants::array_fragment_meta_dir_name) + .to_string(); } std::string commits_dir(const std::string& uri) const { sm::URI backend_uri(get_rest_array_uri(uri)); - return backend_uri.join_path("__commits").to_string(); + return backend_uri.join_path(sm::constants::array_commits_dir_name) + .to_string(); } ~VFSTestSetup() { From 9dd74e1dd7bc64b591fd48e1acc69143d103211b Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Fri, 14 Nov 2025 11:56:35 -0500 Subject: [PATCH 5/6] Fix helper. --- test/src/unit-capi-array.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/test/src/unit-capi-array.cc b/test/src/unit-capi-array.cc index 9970450ef32..aeb6991d82e 100644 --- a/test/src/unit-capi-array.cc +++ b/test/src/unit-capi-array.cc @@ -105,8 +105,7 @@ struct ArrayFx { ~ArrayFx(); void create_temp_dir(const std::string& path); void remove_temp_dir(const std::string& path); - std::string get_array_path( - const std::string& creation_uri, bool legacy_rest) const; + std::string get_array_path(const std::string& creation_uri) const; void create_sparse_vector(const std::string& path); void create_sparse_array(const std::string& path); void create_dense_vector(const std::string& path); @@ -169,9 +168,9 @@ int ArrayFx::get_fragment_timestamps(const char* path, void* data) { return 1; } -std::string ArrayFx::get_array_path( - const std::string& creation_uri, bool legacy_rest) const { - if (legacy_rest || !URI(creation_uri).is_tiledb()) { +std::string ArrayFx::get_array_path(const std::string& creation_uri) const { + if ((fs_vec_[0]->is_rest() && ctx_->rest_client().rest_legacy()) || + !URI(creation_uri).is_tiledb()) { const std::string prefix = "tiledb://unit/"; if (creation_uri.starts_with(prefix)) { return creation_uri.substr(prefix.length()); @@ -932,8 +931,7 @@ TEST_CASE_METHOD( create_temp_dir(temp_dir); create_dense_vector(array_name); - array_path = get_array_path( - array_name, fs_vec_[0]->is_rest() && ctx_->rest_client().rest_legacy()); + array_path = get_array_path(array_name); // ---- FIRST WRITE ---- // Prepare cell buffers @@ -1967,8 +1965,7 @@ TEST_CASE_METHOD( create_temp_dir(temp_dir); create_dense_vector(array_name); - array_path = get_array_path( - array_name, fs_vec_[0]->is_rest() && ctx_->rest_client().rest_legacy()); + array_path = get_array_path(array_name); // Conditionally consolidate // Note: there's no need to vacuum; delete_array will delete all fragments From 39f712374b3ba466d1d9c7162b982aa314872dae Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Fri, 14 Nov 2025 12:26:36 -0500 Subject: [PATCH 6/6] Remove duplication. --- test/src/unit-capi-array.cc | 36 +++++----------------------------- test/support/src/vfs_helpers.h | 8 ++++---- 2 files changed, 9 insertions(+), 35 deletions(-) diff --git a/test/src/unit-capi-array.cc b/test/src/unit-capi-array.cc index aeb6991d82e..3011406c523 100644 --- a/test/src/unit-capi-array.cc +++ b/test/src/unit-capi-array.cc @@ -86,6 +86,9 @@ struct ArrayFx { // The memory tracker shared_ptr memory_tracker_; + // TODO: Update ArrayFx to use VFSTestSetup. + VFSTestSetup vfs_test_setup_; + // TileDB context tiledb_ctx_t* ctx_; tiledb_vfs_t* vfs_; @@ -97,15 +100,11 @@ struct ArrayFx { tiledb_encryption_type_t encryption_type_ = TILEDB_NO_ENCRYPTION; const char* encryption_key_ = nullptr; - // TODO: Update ArrayFx to use VFSTestSetup. - const char* default_bucket_ = "s3://default-bucket"; - // Functions ArrayFx(); ~ArrayFx(); void create_temp_dir(const std::string& path); void remove_temp_dir(const std::string& path); - std::string get_array_path(const std::string& creation_uri) const; void create_sparse_vector(const std::string& path); void create_sparse_array(const std::string& path); void create_dense_vector(const std::string& path); @@ -128,17 +127,6 @@ ArrayFx::ArrayFx() } ArrayFx::~ArrayFx() { - if (fs_vec_[0]->is_rest()) { - int32_t is_empty = 0; - REQUIRE( - tiledb_vfs_is_empty_bucket(ctx_, vfs_, default_bucket_, &is_empty) == - TILEDB_OK); - if (!is_empty) { - REQUIRE( - tiledb_vfs_empty_bucket(ctx_, vfs_, default_bucket_) == TILEDB_OK); - } - } - // Close vfs test REQUIRE(vfs_test_close(fs_vec_, ctx_, vfs_).ok()); tiledb_vfs_free(&vfs_); @@ -168,20 +156,6 @@ int ArrayFx::get_fragment_timestamps(const char* path, void* data) { return 1; } -std::string ArrayFx::get_array_path(const std::string& creation_uri) const { - if ((fs_vec_[0]->is_rest() && ctx_->rest_client().rest_legacy()) || - !URI(creation_uri).is_tiledb()) { - const std::string prefix = "tiledb://unit/"; - if (creation_uri.starts_with(prefix)) { - return creation_uri.substr(prefix.length()); - } - return creation_uri; - } - std::vector uris; - REQUIRE(vfs_->ls(URI(default_bucket_), &uris).ok()); - return uris.back().to_string(); -} - void ArrayFx::create_sparse_vector(const std::string& path) { int rc; int64_t dim_domain[] = {-1, 2}; @@ -931,7 +905,7 @@ TEST_CASE_METHOD( create_temp_dir(temp_dir); create_dense_vector(array_name); - array_path = get_array_path(array_name); + array_path = vfs_test_setup_.get_backend_uri(array_name); // ---- FIRST WRITE ---- // Prepare cell buffers @@ -1965,7 +1939,7 @@ TEST_CASE_METHOD( create_temp_dir(temp_dir); create_dense_vector(array_name); - array_path = get_array_path(array_name); + array_path = vfs_test_setup_.get_backend_uri(array_name); // Conditionally consolidate // Note: there's no need to vacuum; delete_array will delete all fragments diff --git a/test/support/src/vfs_helpers.h b/test/support/src/vfs_helpers.h index 70c6f8bdcf3..a07da2664a7 100644 --- a/test/support/src/vfs_helpers.h +++ b/test/support/src/vfs_helpers.h @@ -918,7 +918,7 @@ struct VFSTestSetup { * @param creation_uri The URI passed to array / group create request. * @return The backend storage location for the created array / group. */ - std::string get_rest_array_uri(const std::string& creation_uri) const { + std::string get_backend_uri(const std::string& creation_uri) const { if (is_legacy_rest() || !sm::URI(creation_uri).is_tiledb()) { const std::string prefix = "tiledb://unit/"; if (creation_uri.starts_with(prefix)) { @@ -932,19 +932,19 @@ struct VFSTestSetup { } std::string fragment_dir(const std::string& uri) const { - sm::URI backend_uri(get_rest_array_uri(uri)); + sm::URI backend_uri(get_backend_uri(uri)); return backend_uri.join_path(sm::constants::array_fragments_dir_name) .to_string(); } std::string fragment_metadata_dir(const std::string& uri) const { - sm::URI backend_uri(get_rest_array_uri(uri)); + sm::URI backend_uri(get_backend_uri(uri)); return backend_uri.join_path(sm::constants::array_fragment_meta_dir_name) .to_string(); } std::string commits_dir(const std::string& uri) const { - sm::URI backend_uri(get_rest_array_uri(uri)); + sm::URI backend_uri(get_backend_uri(uri)); return backend_uri.join_path(sm::constants::array_commits_dir_name) .to_string(); }