summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_engine/executor/executor.test.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-29 12:49:31 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-30 12:10:06 +0200
commit35fe9c1e07464de85ea8138c574c0bc7d07c5a48 (patch)
treee4492c243a867ba593826b25f7f73a389d4e883d /test/buildtool/execution_engine/executor/executor.test.cpp
parentb393090c220da61dd1c197adfac42dc47ad74f8a (diff)
downloadjustbuild-35fe9c1e07464de85ea8138c574c0bc7d07c5a48.tar.gz
executor: Use ApiBundle
...instead of separate local and remote instances. For tests, where different implementations of the IExecutionApi interface are used, ApiBundle instances are created by explicitly setting the struct fields instead of using ApiBundle::Create.
Diffstat (limited to 'test/buildtool/execution_engine/executor/executor.test.cpp')
-rw-r--r--test/buildtool/execution_engine/executor/executor.test.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp
index 2e8a03aa..15752c94 100644
--- a/test/buildtool/execution_engine/executor/executor.test.cpp
+++ b/test/buildtool/execution_engine/executor/executor.test.cpp
@@ -35,6 +35,7 @@
#include "src/buildtool/execution_engine/executor/executor.hpp"
#include "src/buildtool/file_system/file_system_manager.hpp"
#include "src/buildtool/progress_reporting/progress.hpp"
+#include "test/utils/executor/test_api_bundle.hpp"
/// \brief Mockup API test config.
struct TestApiConfig {
@@ -296,9 +297,9 @@ TEST_CASE("Executor: Process artifact", "[executor]") {
RemoteContext const remote_context{.auth = &auth,
.retry_config = &retry_config,
.exec_config = &remote_config};
+ auto const apis = CreateTestApiBundle(hash_function, api);
Executor runner{&repo_config,
- api.get(),
- api.get(),
+ &apis,
&remote_context,
hash_function,
&stats,
@@ -320,9 +321,9 @@ TEST_CASE("Executor: Process artifact", "[executor]") {
RemoteContext const remote_context{.auth = &auth,
.retry_config = &retry_config,
.exec_config = &remote_config};
+ auto const apis = CreateTestApiBundle(hash_function, api);
Executor runner{&repo_config,
- api.get(),
- api.get(),
+ &apis,
&remote_context,
hash_function,
&stats,
@@ -344,9 +345,9 @@ TEST_CASE("Executor: Process artifact", "[executor]") {
RemoteContext const remote_context{.auth = &auth,
.retry_config = &retry_config,
.exec_config = &remote_config};
+ auto const apis = CreateTestApiBundle(hash_function, api);
Executor runner{&repo_config,
- api.get(),
- api.get(),
+ &apis,
&remote_context,
hash_function,
&stats,
@@ -393,9 +394,9 @@ TEST_CASE("Executor: Process action", "[executor]") {
RemoteContext const remote_context{.auth = &auth,
.retry_config = &retry_config,
.exec_config = &remote_config};
+ auto const apis = CreateTestApiBundle(hash_function, api);
Executor runner{&repo_config,
- api.get(),
- api.get(),
+ &apis,
&remote_context,
hash_function,
&stats,
@@ -420,9 +421,9 @@ TEST_CASE("Executor: Process action", "[executor]") {
RemoteContext const remote_context{.auth = &auth,
.retry_config = &retry_config,
.exec_config = &remote_config};
+ auto const apis = CreateTestApiBundle(hash_function, api);
Executor runner{&repo_config,
- api.get(),
- api.get(),
+ &apis,
&remote_context,
hash_function,
&stats,
@@ -447,9 +448,9 @@ TEST_CASE("Executor: Process action", "[executor]") {
RemoteContext const remote_context{.auth = &auth,
.retry_config = &retry_config,
.exec_config = &remote_config};
+ auto const apis = CreateTestApiBundle(hash_function, api);
Executor runner{&repo_config,
- api.get(),
- api.get(),
+ &apis,
&remote_context,
hash_function,
&stats,
@@ -477,9 +478,9 @@ TEST_CASE("Executor: Process action", "[executor]") {
RemoteContext const remote_context{.auth = &auth,
.retry_config = &retry_config,
.exec_config = &remote_config};
+ auto const apis = CreateTestApiBundle(hash_function, api);
Executor runner{&repo_config,
- api.get(),
- api.get(),
+ &apis,
&remote_context,
hash_function,
&stats,
@@ -504,9 +505,9 @@ TEST_CASE("Executor: Process action", "[executor]") {
RemoteContext const remote_context{.auth = &auth,
.retry_config = &retry_config,
.exec_config = &remote_config};
+ auto const apis = CreateTestApiBundle(hash_function, api);
Executor runner{&repo_config,
- api.get(),
- api.get(),
+ &apis,
&remote_context,
hash_function,
&stats,
@@ -534,9 +535,9 @@ TEST_CASE("Executor: Process action", "[executor]") {
RemoteContext const remote_context{.auth = &auth,
.retry_config = &retry_config,
.exec_config = &remote_config};
+ auto const apis = CreateTestApiBundle(hash_function, api);
Executor runner{&repo_config,
- api.get(),
- api.get(),
+ &apis,
&remote_context,
hash_function,
&stats,