From fc0c842eb2e938c7de405e365ff320eb28e04bc7 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Fri, 21 Feb 2025 12:52:19 +0100 Subject: Pass TmpDir to BazelNetwork and BazelCasClient --- .../execution_api/bazel/bazel_cas_client.test.cpp | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp') diff --git a/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp b/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp index 814de567..4b129920 100644 --- a/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp @@ -30,8 +30,9 @@ #include "src/buildtool/execution_api/remote/bazel/bazel_capabilities_client.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/file_system/object_type.hpp" +#include "src/buildtool/storage/config.hpp" #include "src/utils/cpp/expected.hpp" -#include "test/utils/hermeticity/test_hash_function_type.hpp" +#include "test/utils/hermeticity/test_storage_config.hpp" #include "test/utils/remote_execution/test_auth_config.hpp" #include "test/utils/remote_execution/test_remote_config.hpp" @@ -39,6 +40,8 @@ TEST_CASE("Bazel internals: CAS Client", "[execution_api]") { std::string instance_name{"remote-execution"}; std::string content("test"); + auto const storage_config = TestStorageConfig::Create(); + auto auth_config = TestAuthConfig::ReadFromEnvironment(); REQUIRE(auth_config); @@ -51,18 +54,18 @@ TEST_CASE("Bazel internals: CAS Client", "[execution_api]") { remote_config->remote_address->port, &*auth_config, &retry_config); - BazelCasClient cas_client(remote_config->remote_address->host, - remote_config->remote_address->port, - &*auth_config, - &retry_config, - &capabilities); + BazelCasClient cas_client( + remote_config->remote_address->host, + remote_config->remote_address->port, + &*auth_config, + &retry_config, + &capabilities, + storage_config.Get().CreateTypedTmpDir("test_space")); SECTION("Valid digest and blob") { - // digest of "test" - HashFunction const hash_function{TestHashType::ReadFromEnvironment()}; // Valid blob - auto const blob = - ArtifactBlob::FromMemory(hash_function, ObjectType::File, content); + auto const blob = ArtifactBlob::FromMemory( + storage_config.Get().hash_function, ObjectType::File, content); REQUIRE(blob.has_value()); // Search blob via digest -- cgit v1.2.3