summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_api/bazel/bazel_network.test.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-12 16:09:28 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-16 17:51:12 +0200
commit62d204ff4cc94c12c1635f189255710901682825 (patch)
tree0c5cdc5faf98d28ddf74721280756804a6decf83 /test/buildtool/execution_api/bazel/bazel_network.test.cpp
parentde3ef374983d987d8ffd8e8516a4877fe68b3e4e (diff)
downloadjustbuild-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/buildtool/execution_api/bazel/bazel_network.test.cpp')
-rw-r--r--test/buildtool/execution_api/bazel/bazel_network.test.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/test/buildtool/execution_api/bazel/bazel_network.test.cpp b/test/buildtool/execution_api/bazel/bazel_network.test.cpp
index 443ca30d..59fd027f 100644
--- a/test/buildtool/execution_api/bazel/bazel_network.test.cpp
+++ b/test/buildtool/execution_api/bazel/bazel_network.test.cpp
@@ -27,16 +27,25 @@
#include "src/buildtool/execution_api/remote/config.hpp"
#include "src/buildtool/file_system/object_type.hpp"
#include "test/utils/remote_execution/test_auth_config.hpp"
+#include "test/utils/remote_execution/test_remote_config.hpp"
constexpr std::size_t kLargeSize = GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH + 1;
TEST_CASE("Bazel network: write/read blobs", "[execution_api]") {
- auto const& info = RemoteExecutionConfig::RemoteAddress();
std::string instance_name{"remote-execution"};
+
auto auth_config = TestAuthConfig::ReadFromEnvironment();
REQUIRE(auth_config);
- auto network =
- BazelNetwork{instance_name, info->host, info->port, &*auth_config, {}};
+
+ auto remote_config = TestRemoteConfig::ReadFromEnvironment();
+ REQUIRE(remote_config);
+ REQUIRE(remote_config->remote_address);
+
+ auto network = BazelNetwork{instance_name,
+ remote_config->remote_address->host,
+ remote_config->remote_address->port,
+ &*auth_config,
+ {}};
std::string content_foo("foo");
std::string content_bar("bar");
@@ -79,12 +88,20 @@ TEST_CASE("Bazel network: read blobs with unknown size", "[execution_api]") {
return;
}
- auto const& info = RemoteExecutionConfig::RemoteAddress();
std::string instance_name{"remote-execution"};
+
auto auth_config = TestAuthConfig::ReadFromEnvironment();
REQUIRE(auth_config);
- auto network =
- BazelNetwork{instance_name, info->host, info->port, &*auth_config, {}};
+
+ auto remote_config = TestRemoteConfig::ReadFromEnvironment();
+ REQUIRE(remote_config);
+ REQUIRE(remote_config->remote_address);
+
+ auto network = BazelNetwork{instance_name,
+ remote_config->remote_address->host,
+ remote_config->remote_address->port,
+ &*auth_config,
+ {}};
std::string content_foo("foo");
std::string content_bar(kLargeSize, 'x'); // single larger blob