summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_api/bazel/bazel_network.test.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-08-29 17:29:49 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-08-30 17:17:09 +0200
commit013d83eed166049be110d47f00feb4c6af1315af (patch)
treed792e9f6a180337365f639a17c0e07b52b480b37 /test/buildtool/execution_api/bazel/bazel_network.test.cpp
parent576e31959bb7550bdd2b348f5d096f4926e859c6 (diff)
downloadjustbuild-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.cpp42
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}}));