diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-29 16:22:50 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-30 12:10:06 +0200 |
commit | 52060b31212425e3031c5a085ce32e13ee25ce83 (patch) | |
tree | 4edbb2190ec9c368d4c4d29a89da5c103036d09e /test/buildtool/execution_engine/executor/executor.test.cpp | |
parent | 196554bd9064ed6773740ee0760bb051b89ea857 (diff) | |
download | justbuild-52060b31212425e3031c5a085ce32e13ee25ce83.tar.gz |
test executor: Remove unnecessary code duplication
Diffstat (limited to 'test/buildtool/execution_engine/executor/executor.test.cpp')
-rw-r--r-- | test/buildtool/execution_engine/executor/executor.test.cpp | 68 |
1 files changed, 14 insertions, 54 deletions
diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp index 961d5b0f..1148d0ff 100644 --- a/test/buildtool/execution_engine/executor/executor.test.cpp +++ b/test/buildtool/execution_engine/executor/executor.test.cpp @@ -288,16 +288,17 @@ TEST_CASE("Executor: Process artifact", "[executor]") { ArtifactDigest{"known.cpp", 0, /*is_tree=*/false}, ObjectType::File) .Id(); + Auth auth{}; + RetryConfig retry_config{}; // default retry config + RemoteExecutionConfig remote_config{}; // default remote config + RemoteContext const remote_context{.auth = &auth, + .retry_config = &retry_config, + .exec_config = &remote_config}; + SECTION("Processing succeeds for valid config") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - Auth auth{}; - RetryConfig retry_config{}; // default retry config - RemoteExecutionConfig remote_config{}; // default remote config - RemoteContext const remote_context{.auth = &auth, - .retry_config = &retry_config, - .exec_config = &remote_config}; auto const apis = CreateTestApiBundle(hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, @@ -316,12 +317,6 @@ TEST_CASE("Executor: Process artifact", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - Auth auth{}; - RetryConfig retry_config{}; // default retry config - RemoteExecutionConfig remote_config{}; // default remote config - RemoteContext const remote_context{.auth = &auth, - .retry_config = &retry_config, - .exec_config = &remote_config}; auto const apis = CreateTestApiBundle(hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, @@ -340,12 +335,6 @@ TEST_CASE("Executor: Process artifact", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - Auth auth{}; - RetryConfig retry_config{}; // default retry config - RemoteExecutionConfig remote_config{}; // default remote config - RemoteContext const remote_context{.auth = &auth, - .retry_config = &retry_config, - .exec_config = &remote_config}; auto const apis = CreateTestApiBundle(hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, @@ -385,16 +374,17 @@ TEST_CASE("Executor: Process action", "[executor]") { auto const output2_id = ArtifactDescription::CreateAction(action_id, "output2.exe").Id(); + Auth auth{}; + RetryConfig retry_config{}; // default retry config + RemoteExecutionConfig remote_config{}; // default remote config + RemoteContext const remote_context{.auth = &auth, + .retry_config = &retry_config, + .exec_config = &remote_config}; + SECTION("Processing succeeds for valid config") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - Auth auth{}; - RetryConfig retry_config{}; // default retry config - RemoteExecutionConfig remote_config{}; // default remote config - RemoteContext const remote_context{.auth = &auth, - .retry_config = &retry_config, - .exec_config = &remote_config}; auto const apis = CreateTestApiBundle(hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, @@ -416,12 +406,6 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - Auth auth{}; - RetryConfig retry_config{}; // default retry config - RemoteExecutionConfig remote_config{}; // default remote config - RemoteContext const remote_context{.auth = &auth, - .retry_config = &retry_config, - .exec_config = &remote_config}; auto const apis = CreateTestApiBundle(hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, @@ -443,12 +427,6 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - Auth auth{}; - RetryConfig retry_config{}; // default retry config - RemoteExecutionConfig remote_config{}; // default remote config - RemoteContext const remote_context{.auth = &auth, - .retry_config = &retry_config, - .exec_config = &remote_config}; auto const apis = CreateTestApiBundle(hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, @@ -473,12 +451,6 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - Auth auth{}; - RetryConfig retry_config{}; // default retry config - RemoteExecutionConfig remote_config{}; // default remote config - RemoteContext const remote_context{.auth = &auth, - .retry_config = &retry_config, - .exec_config = &remote_config}; auto const apis = CreateTestApiBundle(hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, @@ -500,12 +472,6 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - Auth auth{}; - RetryConfig retry_config{}; // default retry config - RemoteExecutionConfig remote_config{}; // default remote config - RemoteContext const remote_context{.auth = &auth, - .retry_config = &retry_config, - .exec_config = &remote_config}; auto const apis = CreateTestApiBundle(hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, @@ -530,12 +496,6 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - Auth auth{}; - RetryConfig retry_config{}; // default retry config - RemoteExecutionConfig remote_config{}; // default remote config - RemoteContext const remote_context{.auth = &auth, - .retry_config = &retry_config, - .exec_config = &remote_config}; auto const apis = CreateTestApiBundle(hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, |