From 35fe9c1e07464de85ea8138c574c0bc7d07c5a48 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 29 Jul 2024 12:49:31 +0200 Subject: 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. --- .../execution_engine/executor/executor.test.cpp | 37 +++++++++++----------- 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'test/buildtool/execution_engine/executor/executor.test.cpp') 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, -- cgit v1.2.3