diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-02 10:50:48 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-09 13:07:13 +0200 |
commit | 7eafe5779703275d455558120efc754c2dcc3c01 (patch) | |
tree | e31168069ef2460f187652157fe3c03be698d9a8 /test/buildtool/execution_engine | |
parent | 50bcabb0717dae7c8411db59115c41b7cc636cb3 (diff) | |
download | justbuild-7eafe5779703275d455558120efc754c2dcc3c01.tar.gz |
Replace ArtifactDigest::Create
...with ArtifactDigestFactory::HashDataAs
Diffstat (limited to 'test/buildtool/execution_engine')
-rw-r--r-- | test/buildtool/execution_engine/executor/TARGETS | 1 | ||||
-rw-r--r-- | test/buildtool/execution_engine/executor/executor_api.test.hpp | 24 |
2 files changed, 11 insertions, 14 deletions
diff --git a/test/buildtool/execution_engine/executor/TARGETS b/test/buildtool/execution_engine/executor/TARGETS index bbdccc7c..cfe6ec23 100644 --- a/test/buildtool/execution_engine/executor/TARGETS +++ b/test/buildtool/execution_engine/executor/TARGETS @@ -6,6 +6,7 @@ [ ["@", "src", "src/buildtool/auth", "auth"] , ["@", "src", "src/buildtool/common", "artifact_description"] , ["@", "src", "src/buildtool/common", "common"] + , ["@", "src", "src/buildtool/common", "artifact_digest_factory"] , ["@", "src", "src/buildtool/execution_api/common", "common"] , ["@", "src", "src/buildtool/execution_api/remote", "config"] , ["@", "src", "src/buildtool/execution_api/remote", "context"] diff --git a/test/buildtool/execution_engine/executor/executor_api.test.hpp b/test/buildtool/execution_engine/executor/executor_api.test.hpp index 896279ef..24abbb78 100644 --- a/test/buildtool/execution_engine/executor/executor_api.test.hpp +++ b/test/buildtool/execution_engine/executor/executor_api.test.hpp @@ -26,6 +26,7 @@ #include "gsl/gsl" #include "src/buildtool/common/artifact.hpp" #include "src/buildtool/common/artifact_description.hpp" +#include "src/buildtool/common/artifact_digest_factory.hpp" #include "src/buildtool/common/remote/retry_config.hpp" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/common/statistics.hpp" @@ -60,12 +61,11 @@ static inline void RunBlobUpload(RepositoryConfig* repo_config, : HashFunction::Type::GitSHA1}; std::string const blob = "test"; - CHECK(api->Upload(ArtifactBlobContainer{{ArtifactBlob{ - ArtifactDigest{hash_function.HashBlobData(blob).HexString(), - blob.size(), - /*is_tree=*/false}, - blob, - /*is_exec=*/false}}})); + CHECK(api->Upload(ArtifactBlobContainer{ + {ArtifactBlob{ArtifactDigestFactory::HashDataAs<ObjectType::File>( + hash_function, blob), + blob, + /*is_exec=*/false}}})); } [[nodiscard]] static inline auto GetTestDir() -> std::filesystem::path { @@ -426,14 +426,10 @@ static inline void TestUploadAndDownloadTrees( auto foo = std::string{"foo"}; auto bar = std::string{"bar"}; - auto foo_digest = - ArtifactDigest{hash_function.HashBlobData(foo).HexString(), - foo.size(), - /*is_tree=*/false}; - auto bar_digest = - ArtifactDigest{hash_function.HashBlobData(bar).HexString(), - bar.size(), - /*is_tree=*/false}; + auto const foo_digest = + ArtifactDigestFactory::HashDataAs<ObjectType::File>(hash_function, foo); + auto const bar_digest = + ArtifactDigestFactory::HashDataAs<ObjectType::File>(hash_function, bar); // upload blobs auto api = factory(); |