diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-09-12 17:45:14 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-09-16 10:01:34 +0200 |
commit | 49c2382ea5ea45966ef15140fce6ad89672e956c (patch) | |
tree | da781f16f3315f662492af00648fc1469efa55a0 /test/buildtool/execution_engine/executor/executor.test.cpp | |
parent | 7d925d8d6c5fed37bb74506c5b7589b99f5d2885 (diff) | |
download | justbuild-49c2382ea5ea45966ef15140fce6ad89672e956c.tar.gz |
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.
Diffstat (limited to 'test/buildtool/execution_engine/executor/executor.test.cpp')
-rw-r--r-- | test/buildtool/execution_engine/executor/executor.test.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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<gsl::not_null<ArtifactInfos const*>, std::string> final { if (not populated_) { Populate(); } - return artifacts_; + return gsl::not_null<ArtifactInfos const*>(&artifacts_); } [[nodiscard]] auto DirectorySymlinks() noexcept - -> DirSymlinks const& final { + -> expected<gsl::not_null<DirSymlinks const*>, std::string> final { static const DirSymlinks kEmptySymlinks{}; - return kEmptySymlinks; + return gsl::not_null<DirSymlinks const*>(&kEmptySymlinks); } private: |