diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-12 14:28:13 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-13 14:41:00 +0200 |
commit | 5fb67de531fead44123ff30ee5cf37340fc63a0b (patch) | |
tree | 0e1c7c8810e8ee311467e5e07ebb8ff2902adf28 /test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp | |
parent | dd15af0ba4b22348e38d535aadc9fa5e929f3824 (diff) | |
download | justbuild-5fb67de531fead44123ff30ee5cf37340fc63a0b.tar.gz |
Use TestHashType in tests
...instead of calling ProtocolTraits::IsCompatible
Diffstat (limited to 'test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp')
-rw-r--r-- | test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp b/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp index a0f77066..e7df319b 100644 --- a/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_execution_client.test.cpp @@ -18,11 +18,11 @@ #include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/bazel_digest_factory.hpp" -#include "src/buildtool/common/protocol_traits.hpp" #include "src/buildtool/common/remote/retry_config.hpp" #include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/file_system/object_type.hpp" +#include "test/utils/hermeticity/test_hash_function_type.hpp" #include "test/utils/remote_execution/bazel_action_creator.hpp" #include "test/utils/remote_execution/test_auth_config.hpp" #include "test/utils/remote_execution/test_remote_config.hpp" @@ -31,9 +31,7 @@ TEST_CASE("Bazel internals: Execution Client", "[execution_api]") { std::string instance_name{"remote-execution"}; std::string content("test"); - HashFunction const hash_function{ProtocolTraits::Instance().IsCompatible() - ? HashFunction::Type::PlainSHA256 - : HashFunction::Type::GitSHA1}; + HashFunction const hash_function{TestHashType::ReadFromEnvironment()}; auto test_digest = BazelDigestFactory::HashDataAs<ObjectType::File>( hash_function, content); @@ -115,9 +113,7 @@ TEST_CASE("Bazel internals: Execution Client using env variables", std::string instance_name{"remote-execution"}; std::string content("contents of env variable"); - HashFunction const hash_function{ProtocolTraits::Instance().IsCompatible() - ? HashFunction::Type::PlainSHA256 - : HashFunction::Type::GitSHA1}; + HashFunction const hash_function{TestHashType::ReadFromEnvironment()}; auto test_digest = BazelDigestFactory::HashDataAs<ObjectType::File>( hash_function, content); |