diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/buildtool/execution_api/bazel/TARGETS | 1 | ||||
-rw-r--r-- | test/buildtool/execution_api/bazel/bytestream_client.test.cpp | 20 |
2 files changed, 8 insertions, 13 deletions
diff --git a/test/buildtool/execution_api/bazel/TARGETS b/test/buildtool/execution_api/bazel/TARGETS index ee76b1b8..9d86bd55 100644 --- a/test/buildtool/execution_api/bazel/TARGETS +++ b/test/buildtool/execution_api/bazel/TARGETS @@ -50,6 +50,7 @@ , ["utils", "test_auth_config"] , ["utils", "test_remote_config"] , ["@", "src", "src/buildtool/common", "bazel_digest_factory"] + , ["@", "src", "src/buildtool/execution_api/common", "bytestream_utils"] , ["@", "src", "src/buildtool/execution_api/remote", "bazel_network"] , ["@", "src", "src/buildtool/execution_api/remote", "config"] , ["@", "src", "src/buildtool/file_system", "object_type"] diff --git a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp index 03b70ae4..80b78d61 100644 --- a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp @@ -22,6 +22,7 @@ #include "src/buildtool/auth/authentication.hpp" #include "src/buildtool/common/bazel_digest_factory.hpp" #include "src/buildtool/crypto/hash_function.hpp" +#include "src/buildtool/execution_api/common/bytestream_utils.hpp" #include "src/buildtool/execution_api/common/execution_common.hpp" #include "src/buildtool/execution_api/remote/config.hpp" #include "src/buildtool/file_system/object_type.hpp" @@ -60,10 +61,8 @@ TEST_CASE("ByteStream Client: Transfer single blob", "[execution_api]") { content)); SECTION("Download small blob") { - auto data = stream.Read(fmt::format("{}/blobs/{}/{}", - instance_name, - digest.hash(), - digest.size_bytes())); + auto const data = stream.Read( + ByteStreamUtils::ReadRequest{instance_name, digest}); CHECK(data == content); } @@ -108,20 +107,15 @@ TEST_CASE("ByteStream Client: Transfer single blob", "[execution_api]") { content)); SECTION("Download large blob") { - auto data = stream.Read(fmt::format("{}/blobs/{}/{}", - instance_name, - digest.hash(), - digest.size_bytes())); + auto const data = stream.Read( + ByteStreamUtils::ReadRequest{instance_name, digest}); CHECK(data == content); } SECTION("Incrementally download large blob") { - auto reader = - stream.IncrementalRead(fmt::format("{}/blobs/{}/{}", - instance_name, - digest.hash(), - digest.size_bytes())); + auto reader = stream.IncrementalRead( + ByteStreamUtils::ReadRequest{instance_name, digest}); std::string data{}; auto chunk = reader.Next(); |