diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-20 12:57:58 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-21 14:46:30 +0100 |
commit | 93fdd3beba1a44a2d3fd95d01cd2c844709936a8 (patch) | |
tree | 5f467a3e599003cff21451a4caeb7a9975dedf0b /test/buildtool/execution_api/bazel/bytestream_client.test.cpp | |
parent | 185d67664ff4e6cd87a4190ce233bd0cf1a40f98 (diff) | |
download | justbuild-93fdd3beba1a44a2d3fd95d01cd2c844709936a8.tar.gz |
ByteStreamClient: Return ArtifactBlob from Read.
Diffstat (limited to 'test/buildtool/execution_api/bazel/bytestream_client.test.cpp')
-rw-r--r-- | test/buildtool/execution_api/bazel/bytestream_client.test.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp index f607bc3a..20e00aee 100644 --- a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp +++ b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp @@ -15,6 +15,7 @@ #include "src/buildtool/execution_api/remote/bazel/bytestream_client.hpp" #include <cstddef> +#include <memory> #include <optional> #include <string> @@ -58,9 +59,9 @@ TEST_CASE("ByteStream Client: Transfer single blob", "[execution_api]") { ArtifactBlob const blob{digest, content, /*is_exec=*/false}; CHECK(stream.Write(instance_name, blob)); - auto const data = stream.Read(instance_name, digest); - - CHECK(data == content); + auto const downloaded_blob = stream.Read(instance_name, digest); + REQUIRE(downloaded_blob.has_value()); + CHECK(*downloaded_blob->data == content); } SECTION("Small blob with wrong digest") { @@ -94,8 +95,9 @@ TEST_CASE("ByteStream Client: Transfer single blob", "[execution_api]") { CHECK(stream.Write(instance_name, blob)); SECTION("Download large blob") { - auto const data = stream.Read(instance_name, digest); - CHECK(data == content); + auto const downloaded_blob = stream.Read(instance_name, digest); + REQUIRE(downloaded_blob.has_value()); + CHECK(*downloaded_blob->data == content); } SECTION("Incrementally download large blob") { |