summaryrefslogtreecommitdiff
path: root/test/buildtool/build_engine
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-29 17:11:53 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-30 12:10:06 +0200
commitab0e0b86fff94bed224f894be6b555272857e336 (patch)
treea7b7abf004e761b34e58bf68986b6ee2c7d71440 /test/buildtool/build_engine
parente607a21fcf2c1b50e347adbc66c0af3ed0df75aa (diff)
downloadjustbuild-ab0e0b86fff94bed224f894be6b555272857e336.tar.gz
Pass LocalContext to ApiBundle
Diffstat (limited to 'test/buildtool/build_engine')
-rw-r--r--test/buildtool/build_engine/target_map/TARGETS1
-rw-r--r--test/buildtool/build_engine/target_map/target_map.test.cpp65
2 files changed, 42 insertions, 24 deletions
diff --git a/test/buildtool/build_engine/target_map/TARGETS b/test/buildtool/build_engine/target_map/TARGETS
index 9b3865d8..af1a400e 100644
--- a/test/buildtool/build_engine/target_map/TARGETS
+++ b/test/buildtool/build_engine/target_map/TARGETS
@@ -33,6 +33,7 @@
, ["@", "src", "src/buildtool/common", "common"]
, ["@", "src", "src/buildtool/common/remote", "retry_config"]
, ["@", "src", "src/buildtool/execution_api/local", "config"]
+ , ["@", "src", "src/buildtool/execution_api/local", "context"]
, ["@", "src", "src/buildtool/execution_api/remote", "config"]
, ["@", "src", "src/buildtool/file_system", "file_root"]
, ["@", "src", "src/buildtool/progress_reporting", "progress"]
diff --git a/test/buildtool/build_engine/target_map/target_map.test.cpp b/test/buildtool/build_engine/target_map/target_map.test.cpp
index 18927cf4..4524d1b0 100644
--- a/test/buildtool/build_engine/target_map/target_map.test.cpp
+++ b/test/buildtool/build_engine/target_map/target_map.test.cpp
@@ -32,6 +32,7 @@
#include "src/buildtool/crypto/hash_function.hpp"
#include "src/buildtool/execution_api/common/api_bundle.hpp"
#include "src/buildtool/execution_api/local/config.hpp"
+#include "src/buildtool/execution_api/local/context.hpp"
#include "src/buildtool/execution_api/remote/config.hpp"
#include "src/buildtool/file_system/file_root.hpp"
#include "src/buildtool/main/analyse_context.hpp"
@@ -112,9 +113,11 @@ TEST_CASE("simple targets", "[target_map]") {
RemoteExecutionConfig remote_exec_config{};
Auth auth{};
RetryConfig retry_config{};
- ApiBundle const apis{&storage_config.Get(),
- &storage,
- &local_exec_config,
+ // pack the local context instances to be passed to ApiBundle
+ LocalContext const local_context{.exec_config = &local_exec_config,
+ .storage_config = &storage_config.Get(),
+ .storage = &storage};
+ ApiBundle const apis{&local_context,
/*repo_config=*/nullptr,
&auth,
&retry_config,
@@ -566,9 +569,11 @@ TEST_CASE("configuration deduplication", "[target_map]") {
RemoteExecutionConfig remote_exec_config{};
Auth auth{};
RetryConfig retry_config{};
- ApiBundle const apis{&storage_config.Get(),
- &storage,
- &local_exec_config,
+ // pack the local context instances to be passed to ApiBundle
+ LocalContext const local_context{.exec_config = &local_exec_config,
+ .storage_config = &storage_config.Get(),
+ .storage = &storage};
+ ApiBundle const apis{&local_context,
/*repo_config=*/nullptr,
&auth,
&retry_config,
@@ -665,9 +670,11 @@ TEST_CASE("generator functions in string arguments", "[target_map]") {
RemoteExecutionConfig remote_exec_config{};
Auth auth{};
RetryConfig retry_config{};
- ApiBundle const apis{&storage_config.Get(),
- &storage,
- &local_exec_config,
+ // pack the local context instances to be passed to ApiBundle
+ LocalContext const local_context{.exec_config = &local_exec_config,
+ .storage_config = &storage_config.Get(),
+ .storage = &storage};
+ ApiBundle const apis{&local_context,
/*repo_config=*/nullptr,
&auth,
&retry_config,
@@ -776,9 +783,11 @@ TEST_CASE("built-in rules", "[target_map]") {
RemoteExecutionConfig remote_exec_config{};
Auth auth{};
RetryConfig retry_config{};
- ApiBundle const apis{&storage_config.Get(),
- &storage,
- &local_exec_config,
+ // pack the local context instances to be passed to ApiBundle
+ LocalContext const local_context{.exec_config = &local_exec_config,
+ .storage_config = &storage_config.Get(),
+ .storage = &storage};
+ ApiBundle const apis{&local_context,
/*repo_config=*/nullptr,
&auth,
&retry_config,
@@ -999,9 +1008,11 @@ TEST_CASE("target reference", "[target_map]") {
RemoteExecutionConfig remote_exec_config{};
Auth auth{};
RetryConfig retry_config{};
- ApiBundle const apis{&storage_config.Get(),
- &storage,
- &local_exec_config,
+ // pack the local context instances to be passed to ApiBundle
+ LocalContext const local_context{.exec_config = &local_exec_config,
+ .storage_config = &storage_config.Get(),
+ .storage = &storage};
+ ApiBundle const apis{&local_context,
/*repo_config=*/nullptr,
&auth,
&retry_config,
@@ -1153,9 +1164,11 @@ TEST_CASE("trees", "[target_map]") {
RemoteExecutionConfig remote_exec_config{};
Auth auth{};
RetryConfig retry_config{};
- ApiBundle const apis{&storage_config.Get(),
- &storage,
- &local_exec_config,
+ // pack the local context instances to be passed to ApiBundle
+ LocalContext const local_context{.exec_config = &local_exec_config,
+ .storage_config = &storage_config.Get(),
+ .storage = &storage};
+ ApiBundle const apis{&local_context,
/*repo_config=*/nullptr,
&auth,
&retry_config,
@@ -1271,9 +1284,11 @@ TEST_CASE("RESULT error reporting", "[target_map]") {
RemoteExecutionConfig remote_exec_config{};
Auth auth{};
RetryConfig retry_config{};
- ApiBundle const apis{&storage_config.Get(),
- &storage,
- &local_exec_config,
+ // pack the local context instances to be passed to ApiBundle
+ LocalContext const local_context{.exec_config = &local_exec_config,
+ .storage_config = &storage_config.Get(),
+ .storage = &storage};
+ ApiBundle const apis{&local_context,
/*repo_config=*/nullptr,
&auth,
&retry_config,
@@ -1448,9 +1463,11 @@ TEST_CASE("wrong arguments", "[target_map]") {
RemoteExecutionConfig remote_exec_config{};
Auth auth{};
RetryConfig retry_config{};
- ApiBundle const apis{&storage_config.Get(),
- &storage,
- &local_exec_config,
+ // pack the local context instances to be passed to ApiBundle
+ LocalContext const local_context{.exec_config = &local_exec_config,
+ .storage_config = &storage_config.Get(),
+ .storage = &storage};
+ ApiBundle const apis{&local_context,
/*repo_config=*/nullptr,
&auth,
&retry_config,