diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-14 15:16:10 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-19 17:50:30 +0100 |
commit | 8ab573ef1c624e2ed81b2032178c25451176d2f1 (patch) | |
tree | b3e41ee30eed3240bcd18502b7972903e7c2a53e /test/buildtool/execution_engine/executor | |
parent | dfa481bd5f97d92c444dc31a4a051cb890494d1d (diff) | |
download | justbuild-8ab573ef1c624e2ed81b2032178c25451176d2f1.tar.gz |
ApiBundle: Remove HashFunction.
And ensure every user obtains HashFunction from corresponding IExecutionApi
Diffstat (limited to 'test/buildtool/execution_engine/executor')
-rw-r--r-- | test/buildtool/execution_engine/executor/executor.test.cpp | 18 | ||||
-rw-r--r-- | test/buildtool/execution_engine/executor/executor_api.test.hpp | 22 |
2 files changed, 17 insertions, 23 deletions
diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp index 5a72c87b..622ee800 100644 --- a/test/buildtool/execution_engine/executor/executor.test.cpp +++ b/test/buildtool/execution_engine/executor/executor.test.cpp @@ -344,7 +344,7 @@ TEST_CASE("Executor: Process artifact", "[executor]") { auto api = std::make_shared<TestApi>(config, hash_function.GetType()); Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -362,7 +362,7 @@ TEST_CASE("Executor: Process artifact", "[executor]") { auto api = std::make_shared<TestApi>(config, hash_function.GetType()); Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -380,7 +380,7 @@ TEST_CASE("Executor: Process artifact", "[executor]") { auto api = std::make_shared<TestApi>(config, hash_function.GetType()); Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -427,7 +427,7 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = std::make_shared<TestApi>(config, hash_function.GetType()); Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -448,7 +448,7 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = std::make_shared<TestApi>(config, hash_function.GetType()); Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -469,7 +469,7 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = std::make_shared<TestApi>(config, hash_function.GetType()); Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -493,7 +493,7 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = std::make_shared<TestApi>(config, hash_function.GetType()); Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -514,7 +514,7 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = std::make_shared<TestApi>(config, hash_function.GetType()); Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -538,7 +538,7 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = std::make_shared<TestApi>(config, hash_function.GetType()); Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, diff --git a/test/buildtool/execution_engine/executor/executor_api.test.hpp b/test/buildtool/execution_engine/executor/executor_api.test.hpp index c5a2126a..3ef8cd93 100644 --- a/test/buildtool/execution_engine/executor/executor_api.test.hpp +++ b/test/buildtool/execution_engine/executor/executor_api.test.hpp @@ -154,10 +154,8 @@ static inline void RunHelloWorldCompilation( .retry_config = &retry_config, .exec_config = &*remote_config}; - HashFunction const hash_function{TestHashType::ReadFromEnvironment()}; - auto api = factory(); - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = repo_config, .apis = &apis, @@ -287,10 +285,8 @@ static inline void RunGreeterCompilation( .retry_config = &retry_config, .exec_config = &*remote_config}; - HashFunction const hash_function{TestHashType::ReadFromEnvironment()}; - auto api = factory(); - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = repo_config, .apis = &apis, @@ -458,7 +454,7 @@ static inline void TestUploadAndDownloadTrees( .retry_config = &retry_config, .exec_config = &*remote_config}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = repo_config, .apis = &apis, @@ -579,8 +575,6 @@ static inline void TestRetrieveOutputDirectories( int /*expected_cached*/ = 0) { SetupConfig(repo_config); - HashFunction const hash_function{TestHashType::ReadFromEnvironment()}; - auto const make_tree_id = std::string{"make_tree"}; auto const* make_tree_cmd = "mkdir -p baz/baz/\n" @@ -632,7 +626,7 @@ static inline void TestRetrieveOutputDirectories( // run action auto api = factory(); - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = repo_config, .apis = &apis, @@ -686,7 +680,7 @@ static inline void TestRetrieveOutputDirectories( // run action auto api = factory(); - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = repo_config, .apis = &apis, @@ -757,7 +751,7 @@ static inline void TestRetrieveOutputDirectories( // run action auto api = factory(); - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{.repo_config = repo_config, .apis = &apis, @@ -830,7 +824,7 @@ static inline void TestRetrieveOutputDirectories( // run action auto api = factory(); - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{ .repo_config = repo_config, @@ -857,7 +851,7 @@ static inline void TestRetrieveOutputDirectories( // run action auto api = factory(); - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(api); ExecutionContext const exec_context{ .repo_config = repo_config, |