diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-25 14:53:18 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-30 12:10:06 +0200 |
commit | 8669d48933731f224474a9b1dc55824f87ae26a7 (patch) | |
tree | 7d097fdf3f89e5fc88899c8e7f4723a4870f3e60 /test | |
parent | 69f56ad981da59f026c83b321522ad68283934c5 (diff) | |
download | justbuild-8669d48933731f224474a9b1dc55824f87ae26a7.tar.gz |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/buildtool/execution_api/execution_service/TARGETS | 2 | ||||
-rw-r--r-- | test/buildtool/execution_api/execution_service/cas_server.test.cpp | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/test/buildtool/execution_api/execution_service/TARGETS b/test/buildtool/execution_api/execution_service/TARGETS index 754615d5..6001865c 100644 --- a/test/buildtool/execution_api/execution_service/TARGETS +++ b/test/buildtool/execution_api/execution_service/TARGETS @@ -11,6 +11,8 @@ , "src/buildtool/execution_api/execution_service" , "cas_server" ] + , ["@", "src", "src/buildtool/execution_api/local", "config"] + , ["@", "src", "src/buildtool/execution_api/local", "context"] , ["@", "src", "src/buildtool/file_system", "git_repo"] , ["@", "src", "src/buildtool/file_system", "object_type"] , ["@", "src", "src/buildtool/common", "common"] 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. |