From f60d39620b29aeaf1addeb244bdd6e15ddf4894c Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 10 Sep 2024 18:51:20 +0200 Subject: Rename Compatibility class to ProtocolTraits ...and move it to the common stage. --- test/buildtool/storage/TARGETS | 2 +- test/buildtool/storage/large_object_cas.test.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'test/buildtool/storage') diff --git a/test/buildtool/storage/TARGETS b/test/buildtool/storage/TARGETS index 5eeafa9a..7b58b109 100644 --- a/test/buildtool/storage/TARGETS +++ b/test/buildtool/storage/TARGETS @@ -58,6 +58,7 @@ , ["@", "src", "src/buildtool/storage", "config"] , ["utils", "test_storage_config"] , ["@", "src", "src/buildtool/common", "bazel_types"] + , ["@", "src", "src/buildtool/common", "protocol_traits"] , ["utils", "large_object_utils"] , ["@", "src", "src/utils/cpp", "tmp_dir"] , [ "@" @@ -65,7 +66,6 @@ , "src/buildtool/execution_api/bazel_msg" , "bazel_msg_factory" ] - , ["@", "src", "src/buildtool/compatibility", "compatibility"] ] , "stage": ["test", "buildtool", "storage"] } diff --git a/test/buildtool/storage/large_object_cas.test.cpp b/test/buildtool/storage/large_object_cas.test.cpp index f0644694..cbc92038 100644 --- a/test/buildtool/storage/large_object_cas.test.cpp +++ b/test/buildtool/storage/large_object_cas.test.cpp @@ -28,7 +28,7 @@ #include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/bazel_types.hpp" -#include "src/buildtool/compatibility/compatibility.hpp" +#include "src/buildtool/common/protocol_traits.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/object_type.hpp" @@ -405,7 +405,7 @@ static void TestExternal(StorageConfig const& storage_config, REQUIRE(FileSystemManager::IsFile(path)); } - if (kIsTree and not Compatibility::IsCompatible()) { + if (kIsTree and not ProtocolTraits::Instance().IsCompatible()) { // Tree invariants check is omitted in compatible mode. SECTION("Tree invariants check fails") { // Check splice fails due to the tree invariants check. @@ -606,7 +606,7 @@ TEST_CASE("LargeObjectCAS: uplink nested large objects", "[storage]") { // However, in native mode they might be reconstructed on request because // their entries are in the latest generation: - if (not Compatibility::IsCompatible()) { + if (not ProtocolTraits::Instance().IsCompatible()) { auto split_nested_tree_2 = latest.CAS().SplitTree(*nested_tree_digest); REQUIRE(split_nested_tree_2); @@ -720,7 +720,7 @@ auto Tree::StoreRaw(LocalCAS const& cas, return cas.StoreBlob(content); }; - return Compatibility::IsCompatible() + return ProtocolTraits::Instance().IsCompatible() ? BazelMsgFactory::CreateDirectoryDigestFromLocalTree( directory, store_blob, store_tree, store_symlink) : BazelMsgFactory::CreateGitTreeDigestFromLocalTree( -- cgit v1.2.3