summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_api/bazel/bytestream_client.test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/buildtool/execution_api/bazel/bytestream_client.test.cpp')
-rw-r--r--test/buildtool/execution_api/bazel/bytestream_client.test.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp
index b1c49947..9903039b 100644
--- a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp
+++ b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp
@@ -24,17 +24,15 @@
#include "src/buildtool/execution_api/remote/bazel/bytestream_client.hpp"
#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"
constexpr std::size_t kLargeSize = GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH + 1;
TEST_CASE("ByteStream Client: Transfer single blob", "[execution_api]") {
auto const& info = RemoteExecutionConfig::RemoteAddress();
- std::optional<Auth::TLS> auth = {};
- if (Auth::Instance().GetAuthMethod() == AuthMethod::kTLS) {
- auth = Auth::TLS::Instance();
- }
- auto stream =
- ByteStreamClient{info->host, info->port, auth ? &*auth : nullptr};
+ auto auth_config = TestAuthConfig::ReadAuthConfigFromEnvironment();
+ REQUIRE(auth_config);
+ auto stream = ByteStreamClient{info->host, info->port, &*auth_config};
auto uuid = CreateUUIDVersion4(*CreateProcessUniqueId());
SECTION("Upload small blob") {
@@ -112,12 +110,9 @@ TEST_CASE("ByteStream Client: Transfer single blob", "[execution_api]") {
TEST_CASE("ByteStream Client: Transfer multiple blobs", "[execution_api]") {
auto const& info = RemoteExecutionConfig::RemoteAddress();
- std::optional<Auth::TLS> auth = {};
- if (Auth::Instance().GetAuthMethod() == AuthMethod::kTLS) {
- auth = Auth::TLS::Instance();
- }
- auto stream =
- ByteStreamClient{info->host, info->port, auth ? &*auth : nullptr};
+ auto auth_config = TestAuthConfig::ReadAuthConfigFromEnvironment();
+ REQUIRE(auth_config);
+ auto stream = ByteStreamClient{info->host, info->port, &*auth_config};
auto uuid = CreateUUIDVersion4(*CreateProcessUniqueId());
SECTION("Upload small blobs") {