diff options
author | Sascha Roloff <sascha.roloff@huawei.com> | 2022-07-08 10:04:34 +0200 |
---|---|---|
committer | Sascha Roloff <sascha.roloff@huawei.com> | 2022-08-05 14:41:31 +0200 |
commit | bb2375008f69bf62d510ce862f1d4370fa130ef3 (patch) | |
tree | aa757c0eec0455782cb764ce09c46adc8ef250cf /test/buildtool/execution_engine/executor | |
parent | 30c5aa0b3dc37c784311a905f120e0e8b1f651fd (diff) | |
download | justbuild-bb2375008f69bf62d510ce862f1d4370fa130ef3.tar.gz |
Introduced batch availability check for remote execution api
Diffstat (limited to 'test/buildtool/execution_engine/executor')
-rwxr-xr-x | test/buildtool/execution_engine/executor/executor.test.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp index e055dfd7..0ffe5e4d 100755 --- a/test/buildtool/execution_engine/executor/executor.test.cpp +++ b/test/buildtool/execution_engine/executor/executor.test.cpp @@ -154,6 +154,20 @@ class TestApi : public IExecutionApi { return false; } } + [[nodiscard]] auto IsAvailable(std::vector<ArtifactDigest> const& digests) + const noexcept -> std::vector<ArtifactDigest> final { + std::vector<ArtifactDigest> result; + try { + for (auto const& digest : digests) { + if (not config_.artifacts.at(digest.hash()).available) { + result.push_back(digest); + } + } + } catch (std::exception const& /* unused */) { + return result; + } + return result; + } private: TestApiConfig config_{}; |