diff options
Diffstat (limited to 'test/buildtool/execution_engine/executor')
3 files changed, 78 insertions, 43 deletions
diff --git a/test/buildtool/execution_engine/executor/TARGETS b/test/buildtool/execution_engine/executor/TARGETS index 26b4e9a8..ab5c197a 100644 --- a/test/buildtool/execution_engine/executor/TARGETS +++ b/test/buildtool/execution_engine/executor/TARGETS @@ -14,6 +14,7 @@ , ["@", "src", "src/buildtool/progress_reporting", "progress"] , ["@", "catch2", "", "catch2"] , ["@", "gsl", "", "gsl"] + , ["utils", "test_remote_config"] ] , "stage": ["test", "buildtool", "execution_engine", "executor"] } @@ -74,6 +75,7 @@ , ["@", "src", "src/buildtool/progress_reporting", "progress"] , ["utils", "catch-main-remote-execution"] , ["utils", "test_auth_config"] + , ["utils", "test_remote_config"] , ["@", "catch2", "", "catch2"] ] , "stage": ["test", "buildtool", "execution_engine", "executor"] diff --git a/test/buildtool/execution_engine/executor/executor_api.test.hpp b/test/buildtool/execution_engine/executor/executor_api.test.hpp index a57c6f36..6689a87c 100644 --- a/test/buildtool/execution_engine/executor/executor_api.test.hpp +++ b/test/buildtool/execution_engine/executor/executor_api.test.hpp @@ -34,6 +34,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/remote_execution/test_remote_config.hpp" using ApiFactory = std::function<IExecutionApi::Ptr()>; @@ -124,12 +125,15 @@ static inline void RunHelloWorldCompilation( CHECK(g.AddAction(make_hello_desc)); CHECK(g.ArtifactNodeWithId(exec_id)->HasBuilderAction()); + auto remote_config = TestRemoteConfig::ReadFromEnvironment(); + REQUIRE(remote_config); + auto api = factory(); Executor runner{repo_config, api.get(), api.get(), - RemoteExecutionConfig::PlatformProperties(), - RemoteExecutionConfig::DispatchList(), + remote_config->platform_properties, + remote_config->dispatch, auth, stats, progress}; @@ -247,12 +251,15 @@ static inline void RunGreeterCompilation( DependencyGraph g; CHECK(g.Add({compile_greet_desc, make_lib_desc, make_exe_desc})); + auto remote_config = TestRemoteConfig::ReadFromEnvironment(); + REQUIRE(remote_config); + auto api = factory(); Executor runner{repo_config, api.get(), api.get(), - RemoteExecutionConfig::PlatformProperties(), - RemoteExecutionConfig::DispatchList(), + remote_config->platform_properties, + remote_config->dispatch, auth, stats, progress}; @@ -411,11 +418,14 @@ static inline void TestUploadAndDownloadTrees( auto foo_id = g.AddArtifact(foo_desc); auto bar_id = g.AddArtifact(bar_desc); + auto remote_config = TestRemoteConfig::ReadFromEnvironment(); + REQUIRE(remote_config); + Executor runner{repo_config, api.get(), api.get(), - RemoteExecutionConfig::PlatformProperties(), - RemoteExecutionConfig::DispatchList(), + remote_config->platform_properties, + remote_config->dispatch, auth, stats, progress}; @@ -560,6 +570,9 @@ static inline void TestRetrieveOutputDirectories( {}}; }; + auto remote_config = TestRemoteConfig::ReadFromEnvironment(); + REQUIRE(remote_config); + SECTION("entire action output as directory") { auto const make_tree_desc = create_action({}, {""}); auto const root_desc = @@ -578,8 +591,8 @@ static inline void TestRetrieveOutputDirectories( Executor runner{repo_config, api.get(), api.get(), - RemoteExecutionConfig::PlatformProperties(), - RemoteExecutionConfig::DispatchList(), + remote_config->platform_properties, + remote_config->dispatch, auth, stats, progress}; @@ -632,8 +645,8 @@ static inline void TestRetrieveOutputDirectories( Executor runner{repo_config, api.get(), api.get(), - RemoteExecutionConfig::PlatformProperties(), - RemoteExecutionConfig::DispatchList(), + remote_config->platform_properties, + remote_config->dispatch, auth, stats, progress}; @@ -703,8 +716,8 @@ static inline void TestRetrieveOutputDirectories( Executor runner{repo_config, api.get(), api.get(), - RemoteExecutionConfig::PlatformProperties(), - RemoteExecutionConfig::DispatchList(), + remote_config->platform_properties, + remote_config->dispatch, auth, stats, progress}; @@ -776,8 +789,8 @@ static inline void TestRetrieveOutputDirectories( Executor runner{repo_config, api.get(), api.get(), - RemoteExecutionConfig::PlatformProperties(), - RemoteExecutionConfig::DispatchList(), + remote_config->platform_properties, + remote_config->dispatch, auth, stats, progress}; @@ -802,8 +815,8 @@ static inline void TestRetrieveOutputDirectories( Executor runner{repo_config, api.get(), api.get(), - RemoteExecutionConfig::PlatformProperties(), - RemoteExecutionConfig::DispatchList(), + remote_config->platform_properties, + remote_config->dispatch, auth, stats, progress}; diff --git a/test/buildtool/execution_engine/executor/executor_api_remote_bazel.test.cpp b/test/buildtool/execution_engine/executor/executor_api_remote_bazel.test.cpp index cdd47068..26054283 100755 --- a/test/buildtool/execution_engine/executor/executor_api_remote_bazel.test.cpp +++ b/test/buildtool/execution_engine/executor/executor_api_remote_bazel.test.cpp @@ -23,17 +23,25 @@ #include "src/buildtool/progress_reporting/progress.hpp" #include "test/buildtool/execution_engine/executor/executor_api.test.hpp" #include "test/utils/remote_execution/test_auth_config.hpp" +#include "test/utils/remote_execution/test_remote_config.hpp" TEST_CASE("Executor<BazelApi>: Upload blob", "[executor]") { RepositoryConfig repo_config{}; ExecutionConfiguration config; - auto const& info = RemoteExecutionConfig::RemoteAddress(); + + auto remote_config = TestRemoteConfig::ReadFromEnvironment(); + REQUIRE(remote_config); + REQUIRE(remote_config->remote_address); + auto auth_config = TestAuthConfig::ReadFromEnvironment(); REQUIRE(auth_config); TestBlobUpload(&repo_config, [&] { - return BazelApi::Ptr{new BazelApi{ - "remote-execution", info->host, info->port, &*auth_config, config}}; + return BazelApi::Ptr{new BazelApi{"remote-execution", + remote_config->remote_address->host, + remote_config->remote_address->port, + &*auth_config, + config}}; }); } @@ -44,7 +52,9 @@ TEST_CASE("Executor<BazelApi>: Compile hello world", "[executor]") { ExecutionConfiguration config; config.skip_cache_lookup = false; - auto const& info = RemoteExecutionConfig::RemoteAddress(); + auto remote_config = TestRemoteConfig::ReadFromEnvironment(); + REQUIRE(remote_config); + REQUIRE(remote_config->remote_address); auto auth_config = TestAuthConfig::ReadFromEnvironment(); REQUIRE(auth_config); @@ -54,11 +64,12 @@ TEST_CASE("Executor<BazelApi>: Compile hello world", "[executor]") { &stats, &progress, [&] { - return BazelApi::Ptr{new BazelApi{"remote-execution", - info->host, - info->port, - &*auth_config, - config}}; + return BazelApi::Ptr{ + new BazelApi{"remote-execution", + remote_config->remote_address->host, + remote_config->remote_address->port, + &*auth_config, + config}}; }, &*auth_config, false /* not hermetic */); @@ -71,7 +82,9 @@ TEST_CASE("Executor<BazelApi>: Compile greeter", "[executor]") { ExecutionConfiguration config; config.skip_cache_lookup = false; - auto const& info = RemoteExecutionConfig::RemoteAddress(); + auto remote_config = TestRemoteConfig::ReadFromEnvironment(); + REQUIRE(remote_config); + REQUIRE(remote_config->remote_address); auto auth_config = TestAuthConfig::ReadFromEnvironment(); REQUIRE(auth_config); @@ -81,11 +94,12 @@ TEST_CASE("Executor<BazelApi>: Compile greeter", "[executor]") { &stats, &progress, [&] { - return BazelApi::Ptr{new BazelApi{"remote-execution", - info->host, - info->port, - &*auth_config, - config}}; + return BazelApi::Ptr{ + new BazelApi{"remote-execution", + remote_config->remote_address->host, + remote_config->remote_address->port, + &*auth_config, + config}}; }, &*auth_config, false /* not hermetic */); @@ -98,7 +112,9 @@ TEST_CASE("Executor<BazelApi>: Upload and download trees", "[executor]") { ExecutionConfiguration config; config.skip_cache_lookup = false; - auto const& info = RemoteExecutionConfig::RemoteAddress(); + auto remote_config = TestRemoteConfig::ReadFromEnvironment(); + REQUIRE(remote_config); + REQUIRE(remote_config->remote_address); auto auth_config = TestAuthConfig::ReadFromEnvironment(); REQUIRE(auth_config); @@ -108,11 +124,12 @@ TEST_CASE("Executor<BazelApi>: Upload and download trees", "[executor]") { &stats, &progress, [&] { - return BazelApi::Ptr{new BazelApi{"remote-execution", - info->host, - info->port, - &*auth_config, - config}}; + return BazelApi::Ptr{ + new BazelApi{"remote-execution", + remote_config->remote_address->host, + remote_config->remote_address->port, + &*auth_config, + config}}; }, &*auth_config, false /* not hermetic */); @@ -125,7 +142,9 @@ TEST_CASE("Executor<BazelApi>: Retrieve output directories", "[executor]") { ExecutionConfiguration config; config.skip_cache_lookup = false; - auto const& info = RemoteExecutionConfig::RemoteAddress(); + auto remote_config = TestRemoteConfig::ReadFromEnvironment(); + REQUIRE(remote_config); + REQUIRE(remote_config->remote_address); auto auth_config = TestAuthConfig::ReadFromEnvironment(); REQUIRE(auth_config); @@ -135,11 +154,12 @@ TEST_CASE("Executor<BazelApi>: Retrieve output directories", "[executor]") { &stats, &progress, [&] { - return BazelApi::Ptr{new BazelApi{"remote-execution", - info->host, - info->port, - &*auth_config, - config}}; + return BazelApi::Ptr{ + new BazelApi{"remote-execution", + remote_config->remote_address->host, + remote_config->remote_address->port, + &*auth_config, + config}}; }, &*auth_config, false /* not hermetic */); |