From 972bc9108bc52ade30505ae32b38d663ab02b220 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Fri, 20 Dec 2024 16:57:21 +0100 Subject: Implement rebuilding of StorageConfig --- .../execution_api/common/tree_rehashing.test.cpp | 24 +++++++--------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'test/buildtool/execution_api/common/tree_rehashing.test.cpp') diff --git a/test/buildtool/execution_api/common/tree_rehashing.test.cpp b/test/buildtool/execution_api/common/tree_rehashing.test.cpp index 811a5cb4..7f50083c 100644 --- a/test/buildtool/execution_api/common/tree_rehashing.test.cpp +++ b/test/buildtool/execution_api/common/tree_rehashing.test.cpp @@ -43,10 +43,6 @@ #include "test/utils/large_objects/large_object_utils.hpp" namespace { -[[nodiscard]] auto GetTypedStorageConfig(StorageConfig const& config, - HashFunction::Type hash_type) - -> expected; - [[nodiscard]] auto GenerateTestDirectory() -> std::optional; /// \brief Deeply hash a local tree and add it to the storage. @@ -66,13 +62,16 @@ TEST_CASE("Rehash tree", "[common]") { auto const env_config = TestStorageConfig::Create(); // Deploy native storage: - auto const native_config = - GetTypedStorageConfig(env_config.Get(), HashFunction::Type::GitSHA1); + auto const native_config = StorageConfig::Builder::Rebuild(env_config.Get()) + .SetHashType(HashFunction::Type::GitSHA1) + .Build(); REQUIRE(native_config); // Deploy compatible storage: - auto const compatible_config = GetTypedStorageConfig( - env_config.Get(), HashFunction::Type::PlainSHA256); + auto const compatible_config = + StorageConfig::Builder::Rebuild(env_config.Get()) + .SetHashType(HashFunction::Type::PlainSHA256) + .Build(); REQUIRE(compatible_config); // Randomize test directory: @@ -187,15 +186,6 @@ TEST_CASE("Rehash tree", "[common]") { } namespace { -[[nodiscard]] auto GetTypedStorageConfig(StorageConfig const& config, - HashFunction::Type hash_type) - -> expected { - return StorageConfig::Builder{} - .SetBuildRoot(config.build_root) - .SetHashType(hash_type) - .Build(); -} - [[nodiscard]] auto GenerateTestDirectory() -> std::optional { auto const test_dir = FileSystemManager::GetCurrentDirectory() / "tmp"; auto head_temp_directory = TmpDir::Create(test_dir / "head_dir"); -- cgit v1.2.3