diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-12 16:09:28 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-16 17:51:12 +0200 |
commit | 62d204ff4cc94c12c1635f189255710901682825 (patch) | |
tree | 0c5cdc5faf98d28ddf74721280756804a6decf83 /test/utils/remote_execution/bazel_action_creator.hpp | |
parent | de3ef374983d987d8ffd8e8516a4877fe68b3e4e (diff) | |
download | justbuild-62d204ff4cc94c12c1635f189255710901682825.tar.gz |
Remove the RemoteExecutionConfig singleton
...and replace it with passed instances created early via a builder
pattern.
Tests are also updated accordingly.
Diffstat (limited to 'test/utils/remote_execution/bazel_action_creator.hpp')
-rw-r--r-- | test/utils/remote_execution/bazel_action_creator.hpp | 12 |
1 files changed, 9 insertions, 3 deletions
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<std::string, std::string> const& env_vars, std::map<std::string, std::string> const& properties) noexcept -> std::unique_ptr<bazel_re::Digest> { - auto const& info = RemoteExecutionConfig::RemoteAddress(); - auto platform = std::make_unique<bazel_re::Platform>(); 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<gsl::not_null<BazelBlob const*>> blob_ptrs; blob_ptrs.reserve(blobs.size()); |