From 60748d2914568e54f852281141f7c128c3ca1f2c Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 17 Sep 2024 10:20:55 +0200 Subject: Implement ByteStreamUtils::ReadRequest class ...and remove split serialization/deserialization implementations. --- .../execution_api/bazel/bytestream_client.test.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'test/buildtool/execution_api/bazel/bytestream_client.test.cpp') 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(); -- cgit v1.2.3