diff options
author | Sascha Roloff <sascha.roloff@huawei.com> | 2022-07-11 19:55:10 +0200 |
---|---|---|
committer | Sascha Roloff <sascha.roloff@huawei.com> | 2022-08-05 14:41:31 +0200 |
commit | ee6f54124360d8a72b9b545dcc581f3c80d3c8a9 (patch) | |
tree | 20ab0e5e0e8132c30da0f99c401750d712fe00d0 /test/buildtool/execution_engine/executor | |
parent | 76c17ffa9e079fdd3d2a7159c02a1d9593e11930 (diff) | |
download | justbuild-ee6f54124360d8a72b9b545dcc581f3c80d3c8a9.tar.gz |
Modified artifact digest to provide wire digest on demand
Diffstat (limited to 'test/buildtool/execution_engine/executor')
-rwxr-xr-x | test/buildtool/execution_engine/executor/executor.test.cpp | 12 | ||||
-rwxr-xr-x | test/buildtool/execution_engine/executor/executor_api.test.hpp | 15 |
2 files changed, 17 insertions, 10 deletions
diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp index 3e56909e..e055dfd7 100755 --- a/test/buildtool/execution_engine/executor/executor.test.cpp +++ b/test/buildtool/execution_engine/executor/executor.test.cpp @@ -63,9 +63,11 @@ class TestResponse : public IExecutionResponse { // collect files and store them for (auto const& path : config_.execution.outputs) { try { - artifacts.emplace(path, - Artifact::ObjectInfo{ArtifactDigest{path, 0}, - ObjectType::File}); + artifacts.emplace( + path, + Artifact::ObjectInfo{ + ArtifactDigest{path, 0, /*is_tree=*/false}, + ObjectType::File}); } catch (...) { return {}; } @@ -170,8 +172,8 @@ static void SetupConfig(std::filesystem::path const& ws) { SetupConfig(ws); auto const local_cpp_desc = ArtifactDescription{path{"local.cpp"}, ""}; - auto const known_cpp_desc = - ArtifactDescription{ArtifactDigest{"known.cpp", 0}, ObjectType::File}; + auto const known_cpp_desc = ArtifactDescription{ + ArtifactDigest{"known.cpp", 0, /*is_tree=*/false}, ObjectType::File}; auto const test_action_desc = ActionDescription{ {"output1.exe", "output2.exe"}, diff --git a/test/buildtool/execution_engine/executor/executor_api.test.hpp b/test/buildtool/execution_engine/executor/executor_api.test.hpp index d1b13ee5..4fe06aa1 100755 --- a/test/buildtool/execution_engine/executor/executor_api.test.hpp +++ b/test/buildtool/execution_engine/executor/executor_api.test.hpp @@ -28,7 +28,8 @@ static inline void RunBlobUpload(ApiFactory const& factory) { std::string const blob = "test"; CHECK(api->Upload(BlobContainer{{BazelBlob{ ArtifactDigest{HashFunction::ComputeBlobHash(blob).HexString(), - blob.size()}, + blob.size(), + /*is_tree=*/false}, blob}}})); } @@ -273,10 +274,14 @@ static inline void TestUploadAndDownloadTrees(ApiFactory const& factory, auto foo = std::string{"foo"}; auto bar = std::string{"bar"}; - auto foo_digest = ArtifactDigest{ - HashFunction::ComputeBlobHash(foo).HexString(), foo.size()}; - auto bar_digest = ArtifactDigest{ - HashFunction::ComputeBlobHash(bar).HexString(), bar.size()}; + auto foo_digest = + ArtifactDigest{HashFunction::ComputeBlobHash(foo).HexString(), + foo.size(), + /*is_tree=*/false}; + auto bar_digest = + ArtifactDigest{HashFunction::ComputeBlobHash(bar).HexString(), + bar.size(), + /*is_tree=*/false}; // upload blobs auto api = factory(); |