From 49c2382ea5ea45966ef15140fce6ad89672e956c Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 12 Sep 2024 17:45:14 +0200 Subject: execution_response: Allow failures to be reported while populating As populating the containers from remote response only takes place once, no assumptions should be made that this cannot fail (for example if wrong or invalid entries were produced). Instead, return error messages on failure to callers that can log accordingly. --- test/buildtool/execution_engine/executor/executor.test.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (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 48bcf082..e2d62342 100644 --- a/test/buildtool/execution_engine/executor/executor.test.cpp +++ b/test/buildtool/execution_engine/executor/executor.test.cpp @@ -38,6 +38,7 @@ #include "src/buildtool/execution_engine/executor/context.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/progress_reporting/progress.hpp" +#include "src/utils/cpp/expected.hpp" #include "test/utils/executor/test_api_bundle.hpp" #include "test/utils/hermeticity/test_hash_function_type.hpp" @@ -97,16 +98,17 @@ class TestResponse : public IExecutionResponse { static const std::string kEmptyHash; return kEmptyHash; } - [[nodiscard]] auto Artifacts() noexcept -> ArtifactInfos const& final { + [[nodiscard]] auto Artifacts() noexcept + -> expected, std::string> final { if (not populated_) { Populate(); } - return artifacts_; + return gsl::not_null(&artifacts_); } [[nodiscard]] auto DirectorySymlinks() noexcept - -> DirSymlinks const& final { + -> expected, std::string> final { static const DirSymlinks kEmptySymlinks{}; - return kEmptySymlinks; + return gsl::not_null(&kEmptySymlinks); } private: -- cgit v1.2.3