From c8394c2ffc3688356cf985d46e8ce56d72050f6a Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 17 Jul 2024 16:14:12 +0200 Subject: Remove the RetryConfig singleton ...and replace it with instances created early via a builder pattern. --- .../build_engine/target_map/target_map.test.cpp | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'test/buildtool/build_engine') 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 48424bc5..4a475fab 100644 --- a/test/buildtool/build_engine/target_map/target_map.test.cpp +++ b/test/buildtool/build_engine/target_map/target_map.test.cpp @@ -110,12 +110,13 @@ TEST_CASE("simple targets", "[target_map]") { LocalExecutionConfig local_exec_config{}; RemoteExecutionConfig remote_exec_config{}; Auth auth{}; + RetryConfig retry_config{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RetryConfig::Instance(), + &retry_config, &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, @@ -563,12 +564,13 @@ TEST_CASE("configuration deduplication", "[target_map]") { LocalExecutionConfig local_exec_config{}; RemoteExecutionConfig remote_exec_config{}; Auth auth{}; + RetryConfig retry_config{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RetryConfig::Instance(), + &retry_config, &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, @@ -661,12 +663,13 @@ TEST_CASE("generator functions in string arguments", "[target_map]") { LocalExecutionConfig local_exec_config{}; RemoteExecutionConfig remote_exec_config{}; Auth auth{}; + RetryConfig retry_config{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RetryConfig::Instance(), + &retry_config, &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, @@ -771,12 +774,13 @@ TEST_CASE("built-in rules", "[target_map]") { LocalExecutionConfig local_exec_config{}; RemoteExecutionConfig remote_exec_config{}; Auth auth{}; + RetryConfig retry_config{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RetryConfig::Instance(), + &retry_config, &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, @@ -991,12 +995,13 @@ TEST_CASE("target reference", "[target_map]") { LocalExecutionConfig local_exec_config{}; RemoteExecutionConfig remote_exec_config{}; Auth auth{}; + RetryConfig retry_config{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RetryConfig::Instance(), + &retry_config, &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, @@ -1144,12 +1149,13 @@ TEST_CASE("trees", "[target_map]") { LocalExecutionConfig local_exec_config{}; RemoteExecutionConfig remote_exec_config{}; Auth auth{}; + RetryConfig retry_config{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RetryConfig::Instance(), + &retry_config, &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, @@ -1261,12 +1267,13 @@ TEST_CASE("RESULT error reporting", "[target_map]") { LocalExecutionConfig local_exec_config{}; RemoteExecutionConfig remote_exec_config{}; Auth auth{}; + RetryConfig retry_config{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RetryConfig::Instance(), + &retry_config, &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, @@ -1437,12 +1444,13 @@ TEST_CASE("wrong arguments", "[target_map]") { LocalExecutionConfig local_exec_config{}; RemoteExecutionConfig remote_exec_config{}; Auth auth{}; + RetryConfig retry_config{}; ApiBundle const apis{&storage_config.Get(), &storage, &local_exec_config, /*repo_config=*/nullptr, &auth, - &RetryConfig::Instance(), + &retry_config, &remote_exec_config}; auto serve = ServeApi::Create(*serve_config, &storage, &apis); AnalyseContext ctx{.repo_config = &repo_config, -- cgit v1.2.3