From b393090c220da61dd1c197adfac42dc47ad74f8a Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 29 Jul 2024 11:13:08 +0200 Subject: ApiBundle: Use a creator method instead of constructor This will allow for ApiBundle to be used together with the TestApi implementation of IExecutionApi in tests. Also rename CreateRemote method to MakeRemote in order to remove any semantical confusion. --- .../graph_traverser/graph_traverser.test.hpp | 28 ++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'test/buildtool/graph_traverser/graph_traverser.test.hpp') diff --git a/test/buildtool/graph_traverser/graph_traverser.test.hpp b/test/buildtool/graph_traverser/graph_traverser.test.hpp index 314d7bd6..6618e5bf 100644 --- a/test/buildtool/graph_traverser/graph_traverser.test.hpp +++ b/test/buildtool/graph_traverser/graph_traverser.test.hpp @@ -186,7 +186,8 @@ class TestProject { .retry_config = &retry_config, .exec_config = remote_config}; - ApiBundle const apis{&local_context, &remote_context, p.GetRepoConfig()}; + auto const apis = + ApiBundle::Create(&local_context, &remote_context, p.GetRepoConfig()); GraphTraverser const gt{clargs.gtargs, p.GetRepoConfig(), @@ -264,7 +265,8 @@ class TestProject { .retry_config = &retry_config, .exec_config = remote_config}; - ApiBundle const apis{&local_context, &remote_context, p.GetRepoConfig()}; + auto const apis = + ApiBundle::Create(&local_context, &remote_context, p.GetRepoConfig()); GraphTraverser const gt{clargs.gtargs, p.GetRepoConfig(), @@ -312,7 +314,8 @@ class TestProject { .retry_config = &retry_config, .exec_config = remote_config}; - ApiBundle const apis{&local_context, &remote_context, p.GetRepoConfig()}; + auto const apis = + ApiBundle::Create(&local_context, &remote_context, p.GetRepoConfig()); GraphTraverser const gt{clargs.gtargs, p.GetRepoConfig(), @@ -379,8 +382,8 @@ class TestProject { .retry_config = &retry_config, .exec_config = remote_config}; - ApiBundle const apis{ - &local_context, &remote_context, full_hello_world.GetRepoConfig()}; + auto const apis = ApiBundle::Create( + &local_context, &remote_context, full_hello_world.GetRepoConfig()); GraphTraverser const gt_upload{clargs_update_cpp.gtargs, full_hello_world.GetRepoConfig(), @@ -453,7 +456,8 @@ static void TestBlobsUploadedAndUsed( .retry_config = &retry_config, .exec_config = remote_config}; - ApiBundle const apis{&local_context, &remote_context, p.GetRepoConfig()}; + auto const apis = + ApiBundle::Create(&local_context, &remote_context, p.GetRepoConfig()); GraphTraverser gt{clargs.gtargs, p.GetRepoConfig(), @@ -509,7 +513,8 @@ static void TestEnvironmentVariablesSetAndUsed( .retry_config = &retry_config, .exec_config = remote_config}; - ApiBundle const apis{&local_context, &remote_context, p.GetRepoConfig()}; + auto const apis = + ApiBundle::Create(&local_context, &remote_context, p.GetRepoConfig()); GraphTraverser gt{clargs.gtargs, p.GetRepoConfig(), @@ -565,7 +570,8 @@ static void TestTreesUsed( .retry_config = &retry_config, .exec_config = remote_config}; - ApiBundle const apis{&local_context, &remote_context, p.GetRepoConfig()}; + auto const apis = + ApiBundle::Create(&local_context, &remote_context, p.GetRepoConfig()); GraphTraverser gt{clargs.gtargs, p.GetRepoConfig(), @@ -621,7 +627,8 @@ static void TestNestedTreesUsed( .retry_config = &retry_config, .exec_config = remote_config}; - ApiBundle const apis{&local_context, &remote_context, p.GetRepoConfig()}; + auto const apis = + ApiBundle::Create(&local_context, &remote_context, p.GetRepoConfig()); GraphTraverser gt{clargs.gtargs, p.GetRepoConfig(), @@ -676,7 +683,8 @@ static void TestFlakyHelloWorldDetected( .retry_config = &retry_config, .exec_config = remote_config}; - ApiBundle const apis{&local_context, &remote_context, p.GetRepoConfig()}; + auto const apis = + ApiBundle::Create(&local_context, &remote_context, p.GetRepoConfig()); { auto clargs = p.CmdLineArgs("_entry_points_ctimes"); -- cgit v1.2.3