From bb2375008f69bf62d510ce862f1d4370fa130ef3 Mon Sep 17 00:00:00 2001 From: Sascha Roloff Date: Fri, 8 Jul 2022 10:04:34 +0200 Subject: Introduced batch availability check for remote execution api --- test/buildtool/execution_engine/executor/executor.test.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/buildtool/execution_engine/executor/executor.test.cpp') 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 const& digests) + const noexcept -> std::vector final { + std::vector 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_{}; -- cgit v1.2.3