From 62d204ff4cc94c12c1635f189255710901682825 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Fri, 12 Jul 2024 16:09:28 +0200 Subject: Remove the RemoteExecutionConfig singleton ...and replace it with passed instances created early via a builder pattern. Tests are also updated accordingly. --- test/utils/remote_execution/bazel_action_creator.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test/utils/remote_execution/bazel_action_creator.hpp') diff --git a/test/utils/remote_execution/bazel_action_creator.hpp b/test/utils/remote_execution/bazel_action_creator.hpp index 1199a385..c7b24f2b 100644 --- a/test/utils/remote_execution/bazel_action_creator.hpp +++ b/test/utils/remote_execution/bazel_action_creator.hpp @@ -29,6 +29,7 @@ #include "src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "test/utils/remote_execution/test_auth_config.hpp" +#include "test/utils/remote_execution/test_remote_config.hpp" [[nodiscard]] static inline auto CreateAction( std::string const& instance_name, @@ -36,8 +37,6 @@ std::map const& env_vars, std::map const& properties) noexcept -> std::unique_ptr { - auto const& info = RemoteExecutionConfig::RemoteAddress(); - auto platform = std::make_unique(); for (auto const& [name, value] : properties) { bazel_re::Platform_Property property; @@ -88,7 +87,14 @@ return nullptr; } - BazelCasClient cas_client(info->host, info->port, &*auth_config); + auto remote_config = TestRemoteConfig::ReadFromEnvironment(); + if (not remote_config or not remote_config->remote_address) { + return nullptr; + } + + BazelCasClient cas_client(remote_config->remote_address->host, + remote_config->remote_address->port, + &*auth_config); std::vector> blob_ptrs; blob_ptrs.reserve(blobs.size()); -- cgit v1.2.3