diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-17 10:20:55 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-18 09:45:19 +0200 |
commit | 60748d2914568e54f852281141f7c128c3ca1f2c (patch) | |
tree | 144ebe2871a46bc8b250892e3fd0ac948647763e /test/buildtool/execution_api/bazel/bytestream_client.test.cpp | |
parent | 7d2f632b1dd1fe2ca01ef89716efe355e4d32687 (diff) | |
download | justbuild-60748d2914568e54f852281141f7c128c3ca1f2c.tar.gz |
Implement ByteStreamUtils::ReadRequest class
...and remove split serialization/deserialization implementations.
Diffstat (limited to 'test/buildtool/execution_api/bazel/bytestream_client.test.cpp')
-rw-r--r-- | test/buildtool/execution_api/bazel/bytestream_client.test.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
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(); |