summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_api/common
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-12-20 16:57:21 +0100
committerMaksim Denisov <denisov.maksim@huawei.com>2025-01-07 14:18:09 +0100
commit972bc9108bc52ade30505ae32b38d663ab02b220 (patch)
treeb3230e6208523a28e5bf4cdaeff3f4852a19eebe /test/buildtool/execution_api/common
parent71ffe14b0083c9c4975f66db4127de9ee5b9a84d (diff)
downloadjustbuild-972bc9108bc52ade30505ae32b38d663ab02b220.tar.gz
Implement rebuilding of StorageConfig
Diffstat (limited to 'test/buildtool/execution_api/common')
-rw-r--r--test/buildtool/execution_api/common/tree_rehashing.test.cpp24
1 files changed, 7 insertions, 17 deletions
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<StorageConfig, std::string>;
-
[[nodiscard]] auto GenerateTestDirectory() -> std::optional<TmpDirPtr>;
/// \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<StorageConfig, std::string> {
- return StorageConfig::Builder{}
- .SetBuildRoot(config.build_root)
- .SetHashType(hash_type)
- .Build();
-}
-
[[nodiscard]] auto GenerateTestDirectory() -> std::optional<TmpDirPtr> {
auto const test_dir = FileSystemManager::GetCurrentDirectory() / "tmp";
auto head_temp_directory = TmpDir::Create(test_dir / "head_dir");