From e4bbf59415e610fc090572aff29cd20cdb9c41f8 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Mon, 13 Jun 2022 13:30:13 +0200 Subject: RemoteExecutionConfig: Keep global platform properties ... and cache endpoint address for rebuilding. --- test/utils/remote_execution/main-remote-execution.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'test/utils/remote_execution/main-remote-execution.cpp') diff --git a/test/utils/remote_execution/main-remote-execution.cpp b/test/utils/remote_execution/main-remote-execution.cpp index 4db1d690..e930d893 100644 --- a/test/utils/remote_execution/main-remote-execution.cpp +++ b/test/utils/remote_execution/main-remote-execution.cpp @@ -27,12 +27,18 @@ void wait_for_grpc_to_shutdown() { HashGenerator::SetHashGenerator(HashGenerator::HashType::SHA256); } auto address = ReadRemoteAddressFromEnv(); - auto& config = RemoteExecutionConfig::Instance(); - if (address and not config.SetAddress(*address)) { + if (address and not RemoteExecutionConfig::SetRemoteAddress(*address)) { Logger::Log(LogLevel::Error, "parsing address '{}' failed.", *address); std::exit(EXIT_FAILURE); } - return config.IsValidAddress(); + for (auto const& property : ReadPlatformPropertiesFromEnv()) { + if (not RemoteExecutionConfig::AddPlatformProperty(property)) { + Logger::Log( + LogLevel::Error, "parsing property '{}' failed.", property); + std::exit(EXIT_FAILURE); + } + } + return static_cast(RemoteExecutionConfig::RemoteAddress()); } } // namespace -- cgit v1.2.3