summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_api/bazel/bytestream_client.test.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-09-17 12:06:50 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-09-18 09:45:19 +0200
commit2ba863c83b946fb08acfa2257d838987d373208f (patch)
treefb8188d3456275fdd0f22816a49e198687b273a3 /test/buildtool/execution_api/bazel/bytestream_client.test.cpp
parent60748d2914568e54f852281141f7c128c3ca1f2c (diff)
downloadjustbuild-2ba863c83b946fb08acfa2257d838987d373208f.tar.gz
Implement ByteStreamUtils::WriteRequest class
...and remove split serialization/deserialization logic.
Diffstat (limited to 'test/buildtool/execution_api/bazel/bytestream_client.test.cpp')
-rw-r--r--test/buildtool/execution_api/bazel/bytestream_client.test.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp
index 80b78d61..16adb0cd 100644
--- a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp
+++ b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp
@@ -53,12 +53,9 @@ TEST_CASE("ByteStream Client: Transfer single blob", "[execution_api]") {
auto digest = BazelDigestFactory::HashDataAs<ObjectType::File>(
hash_function, content);
- CHECK(stream.Write(fmt::format("{}/uploads/{}/blobs/{}/{}",
- instance_name,
- uuid,
- digest.hash(),
- digest.size_bytes()),
- content));
+ CHECK(stream.Write(
+ ByteStreamUtils::WriteRequest{instance_name, uuid, digest},
+ content));
SECTION("Download small blob") {
auto const data = stream.Read(
@@ -77,12 +74,9 @@ TEST_CASE("ByteStream Client: Transfer single blob", "[execution_api]") {
auto digest = BazelDigestFactory::HashDataAs<ObjectType::File>(
hash_function, other_content);
- CHECK(not stream.Write(fmt::format("{}/uploads/{}/blobs/{}/{}",
- instance_name,
- uuid,
- digest.hash(),
- digest.size_bytes()),
- content));
+ CHECK(not stream.Write(
+ ByteStreamUtils::WriteRequest{instance_name, uuid, digest},
+ content));
}
SECTION("Upload large blob") {
@@ -99,12 +93,9 @@ TEST_CASE("ByteStream Client: Transfer single blob", "[execution_api]") {
auto digest = BazelDigestFactory::HashDataAs<ObjectType::File>(
hash_function, content);
- CHECK(stream.Write(fmt::format("{}/uploads/{}/blobs/{}/{}",
- instance_name,
- uuid,
- digest.hash(),
- digest.size_bytes()),
- content));
+ CHECK(stream.Write(
+ ByteStreamUtils::WriteRequest{instance_name, uuid, digest},
+ content));
SECTION("Download large blob") {
auto const data = stream.Read(