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/execution_service | |
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/execution_service')
-rw-r--r-- | test/buildtool/execution_api/execution_service/TARGETS | 1 | ||||
-rw-r--r-- | test/buildtool/execution_api/execution_service/cas_server.test.cpp | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/test/buildtool/execution_api/execution_service/TARGETS b/test/buildtool/execution_api/execution_service/TARGETS index 0e32c4ad..a2c1e9dd 100644 --- a/test/buildtool/execution_api/execution_service/TARGETS +++ b/test/buildtool/execution_api/execution_service/TARGETS @@ -16,6 +16,7 @@ , ["@", "src", "src/buildtool/file_system", "git_repo"] , ["@", "src", "src/buildtool/file_system", "object_type"] , ["@", "src", "src/buildtool/common", "common"] + , ["@", "src", "src/buildtool/common", "bazel_digest_factory"] , ["@", "src", "src/buildtool/storage", "config"] , ["@", "src", "src/buildtool/storage", "storage"] , ["@", "gsl", "", "gsl"] diff --git a/test/buildtool/execution_api/execution_service/cas_server.test.cpp b/test/buildtool/execution_api/execution_service/cas_server.test.cpp index 4bc90546..ca88b17b 100644 --- a/test/buildtool/execution_api/execution_service/cas_server.test.cpp +++ b/test/buildtool/execution_api/execution_service/cas_server.test.cpp @@ -19,6 +19,7 @@ #include "catch2/catch_test_macros.hpp" #include "gsl/gsl" #include "src/buildtool/common/artifact_digest.hpp" +#include "src/buildtool/common/bazel_digest_factory.hpp" #include "src/buildtool/execution_api/local/config.hpp" #include "src/buildtool/execution_api/local/context.hpp" #include "src/buildtool/file_system/git_repo.hpp" @@ -66,7 +67,7 @@ TEST_CASE("CAS Service: upload incomplete tree", "[execution_service]") { auto empty_entries = GitRepo::tree_entries_t{}; auto empty_tree = GitRepo::CreateShallowTree(empty_entries); REQUIRE(empty_tree); - auto empty_tree_digest = ArtifactDigest::Create<ObjectType::Tree>( + auto empty_tree_digest = BazelDigestFactory::HashDataAs<ObjectType::Tree>( storage_config.Get().hash_function, empty_tree->second); // Create a tree containing the empty tree. @@ -74,7 +75,7 @@ TEST_CASE("CAS Service: upload incomplete tree", "[execution_service]") { entries[empty_tree->first].emplace_back("empty_tree", ObjectType::Tree); auto tree = GitRepo::CreateShallowTree(entries); REQUIRE(tree); - auto tree_digest = ArtifactDigest::Create<ObjectType::Tree>( + auto tree_digest = BazelDigestFactory::HashDataAs<ObjectType::Tree>( storage_config.Get().hash_function, tree->second); // Upload tree. The tree invariant is violated, thus, a negative answer is |