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_network.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_network.test.cpp')
-rw-r--r-- | test/buildtool/execution_api/bazel/bazel_network.test.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/test/buildtool/execution_api/bazel/bazel_network.test.cpp b/test/buildtool/execution_api/bazel/bazel_network.test.cpp index c69e7619..8224de74 100644 --- a/test/buildtool/execution_api/bazel/bazel_network.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_network.test.cpp @@ -29,6 +29,7 @@ #include "src/buildtool/execution_api/remote/bazel/bazel_execution_client.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/test_auth_config.hpp" #include "test/utils/remote_execution/test_remote_config.hpp" @@ -46,9 +47,7 @@ TEST_CASE("Bazel network: write/read blobs", "[execution_api]") { RetryConfig retry_config{}; // default retry config - HashFunction const hash_function{ProtocolTraits::Instance().IsCompatible() - ? HashFunction::Type::PlainSHA256 - : HashFunction::Type::GitSHA1}; + HashFunction const hash_function{TestHashType::ReadFromEnvironment()}; auto network = BazelNetwork{instance_name, remote_config->remote_address->host, @@ -97,7 +96,8 @@ TEST_CASE("Bazel network: write/read blobs", "[execution_api]") { } TEST_CASE("Bazel network: read blobs with unknown size", "[execution_api]") { - if (ProtocolTraits::Instance().IsCompatible()) { + HashFunction const hash_function{TestHashType::ReadFromEnvironment()}; + if (not ProtocolTraits::IsNative(hash_function.GetType())) { // only supported in native mode return; } @@ -113,10 +113,6 @@ TEST_CASE("Bazel network: read blobs with unknown size", "[execution_api]") { RetryConfig retry_config{}; // default retry config - HashFunction const hash_function{ProtocolTraits::Instance().IsCompatible() - ? HashFunction::Type::PlainSHA256 - : HashFunction::Type::GitSHA1}; - auto network = BazelNetwork{instance_name, remote_config->remote_address->host, remote_config->remote_address->port, |