From 013d83eed166049be110d47f00feb4c6af1315af Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 29 Aug 2024 17:29:49 +0200 Subject: Use BazelDigestFactory to create bazel_re::Digest directly if needed ...bypassing ArtifactDigest functionality. --- .../execution_api/bazel/bazel_network.test.cpp | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'test/buildtool/execution_api/bazel/bazel_network.test.cpp') diff --git a/test/buildtool/execution_api/bazel/bazel_network.test.cpp b/test/buildtool/execution_api/bazel/bazel_network.test.cpp index edc35ea7..01c5aea9 100644 --- a/test/buildtool/execution_api/bazel/bazel_network.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_network.test.cpp @@ -21,7 +21,7 @@ #include "catch2/catch_test_macros.hpp" #include "src/buildtool/auth/authentication.hpp" -#include "src/buildtool/common/artifact_digest.hpp" +#include "src/buildtool/common/bazel_digest_factory.hpp" #include "src/buildtool/common/remote/retry_config.hpp" #include "src/buildtool/compatibility/compatibility.hpp" #include "src/buildtool/crypto/hash_function.hpp" @@ -62,18 +62,18 @@ TEST_CASE("Bazel network: write/read blobs", "[execution_api]") { std::string content_bar("bar"); std::string content_baz(kLargeSize, 'x'); // single larger blob - BazelBlob foo{ - ArtifactDigest::Create(hash_function, content_foo), - content_foo, - /*is_exec=*/false}; - BazelBlob bar{ - ArtifactDigest::Create(hash_function, content_bar), - content_bar, - /*is_exec=*/false}; - BazelBlob baz{ - ArtifactDigest::Create(hash_function, content_baz), - content_baz, - /*is_exec=*/false}; + BazelBlob foo{BazelDigestFactory::HashDataAs( + hash_function, content_foo), + content_foo, + /*is_exec=*/false}; + BazelBlob bar{BazelDigestFactory::HashDataAs( + hash_function, content_bar), + content_bar, + /*is_exec=*/false}; + BazelBlob baz{BazelDigestFactory::HashDataAs( + hash_function, content_baz), + content_baz, + /*is_exec=*/false}; // Search blobs via digest REQUIRE(network.UploadBlobs(BazelBlobContainer{{foo, bar, baz}})); @@ -128,14 +128,14 @@ TEST_CASE("Bazel network: read blobs with unknown size", "[execution_api]") { std::string content_foo("foo"); std::string content_bar(kLargeSize, 'x'); // single larger blob - BazelBlob foo{ - ArtifactDigest::Create(hash_function, content_foo), - content_foo, - /*is_exec=*/false}; - BazelBlob bar{ - ArtifactDigest::Create(hash_function, content_bar), - content_bar, - /*is_exec=*/false}; + BazelBlob foo{BazelDigestFactory::HashDataAs( + hash_function, content_foo), + content_foo, + /*is_exec=*/false}; + BazelBlob bar{BazelDigestFactory::HashDataAs( + hash_function, content_bar), + content_bar, + /*is_exec=*/false}; // Upload blobs REQUIRE(network.UploadBlobs(BazelBlobContainer{{foo, bar}})); -- cgit v1.2.3