diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-08-29 17:29:49 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-08-30 17:17:09 +0200 |
commit | 013d83eed166049be110d47f00feb4c6af1315af (patch) | |
tree | d792e9f6a180337365f639a17c0e07b52b480b37 /test/buildtool/execution_api/bazel/bazel_network.test.cpp | |
parent | 576e31959bb7550bdd2b348f5d096f4926e859c6 (diff) | |
download | justbuild-013d83eed166049be110d47f00feb4c6af1315af.tar.gz |
Use BazelDigestFactory to create bazel_re::Digest directly if needed
...bypassing ArtifactDigest functionality.
Diffstat (limited to 'test/buildtool/execution_api/bazel/bazel_network.test.cpp')
-rw-r--r-- | test/buildtool/execution_api/bazel/bazel_network.test.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
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<ObjectType::File>(hash_function, content_foo), - content_foo, - /*is_exec=*/false}; - BazelBlob bar{ - ArtifactDigest::Create<ObjectType::File>(hash_function, content_bar), - content_bar, - /*is_exec=*/false}; - BazelBlob baz{ - ArtifactDigest::Create<ObjectType::File>(hash_function, content_baz), - content_baz, - /*is_exec=*/false}; + BazelBlob foo{BazelDigestFactory::HashDataAs<ObjectType::File>( + hash_function, content_foo), + content_foo, + /*is_exec=*/false}; + BazelBlob bar{BazelDigestFactory::HashDataAs<ObjectType::File>( + hash_function, content_bar), + content_bar, + /*is_exec=*/false}; + BazelBlob baz{BazelDigestFactory::HashDataAs<ObjectType::File>( + 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<ObjectType::File>(hash_function, content_foo), - content_foo, - /*is_exec=*/false}; - BazelBlob bar{ - ArtifactDigest::Create<ObjectType::File>(hash_function, content_bar), - content_bar, - /*is_exec=*/false}; + BazelBlob foo{BazelDigestFactory::HashDataAs<ObjectType::File>( + hash_function, content_foo), + content_foo, + /*is_exec=*/false}; + BazelBlob bar{BazelDigestFactory::HashDataAs<ObjectType::File>( + hash_function, content_bar), + content_bar, + /*is_exec=*/false}; // Upload blobs REQUIRE(network.UploadBlobs(BazelBlobContainer{{foo, bar}})); |