From 8669d48933731f224474a9b1dc55824f87ae26a7 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Thu, 25 Jul 2024 14:53:18 +0200 Subject: Use LocalContext in execution and serve services The context is passed by not_null const pointer in order to avoid binding to temporaries, and it or parts of it get stored by const ref where needed. --- .../execution_api/execution_service/cas_server.test.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test/buildtool/execution_api/execution_service/cas_server.test.cpp') diff --git a/test/buildtool/execution_api/execution_service/cas_server.test.cpp b/test/buildtool/execution_api/execution_service/cas_server.test.cpp index 3e566861..80aaa76b 100644 --- a/test/buildtool/execution_api/execution_service/cas_server.test.cpp +++ b/test/buildtool/execution_api/execution_service/cas_server.test.cpp @@ -18,6 +18,8 @@ #include "gsl/gsl" #include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/execution_api/execution_service/cas_server.hpp" +#include "src/buildtool/execution_api/local/config.hpp" +#include "src/buildtool/execution_api/local/context.hpp" #include "src/buildtool/file_system/git_repo.hpp" #include "src/buildtool/file_system/object_type.hpp" #include "src/buildtool/storage/config.hpp" @@ -49,8 +51,14 @@ TEST_CASE("CAS Service: upload incomplete tree", "[execution_service]") { auto const storage_config = TestStorageConfig::Create(); auto const storage = Storage::Create(&storage_config.Get()); + LocalExecutionConfig const local_exec_config{}; - auto cas_server = CASServiceImpl{&storage_config.Get(), &storage}; + // pack the local context instances to be passed + LocalContext const local_context{.exec_config = &local_exec_config, + .storage_config = &storage_config.Get(), + .storage = &storage}; + + auto cas_server = CASServiceImpl{&local_context}; auto instance_name = std::string{"remote-execution"}; // Create an empty tree. -- cgit v1.2.3