summaryrefslogtreecommitdiff
path: root/test/utils/test_env.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/utils/test_env.hpp')
-rw-r--r--test/utils/test_env.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/utils/test_env.hpp b/test/utils/test_env.hpp
index 7013d2ff..47396db2 100644
--- a/test/utils/test_env.hpp
+++ b/test/utils/test_env.hpp
@@ -54,6 +54,14 @@ static inline void ReadCompatibilityFromEnv() {
: std::make_optional(std::string{execution_address});
}
+[[nodiscard]] static inline auto ReadRemoteServeAddressFromEnv()
+ -> std::optional<std::string> {
+ auto* serve_address = std::getenv("REMOTE_SERVE_ADDRESS");
+ return serve_address == nullptr
+ ? std::nullopt
+ : std::make_optional(std::string{serve_address});
+}
+
[[nodiscard]] static inline auto ReadTLSAuthArgsFromEnv() -> bool {
auto* ca_cert = std::getenv("TLS_CA_CERT");
auto* client_cert = std::getenv("TLS_CLIENT_CERT");
@@ -81,4 +89,18 @@ static inline void ReadCompatibilityFromEnv() {
return true;
}
+[[nodiscard]] static inline auto ReadRemoteServeReposFromEnv()
+ -> std::vector<std::filesystem::path> {
+ std::vector<std::filesystem::path> repos{};
+ auto* serve_repos = std::getenv("SERVE_REPOSITORIES");
+ if (serve_repos not_eq nullptr) {
+ std::istringstream pss(std::string{serve_repos});
+ std::string path;
+ while (std::getline(pss, path, ';')) {
+ repos.emplace_back(path);
+ }
+ }
+ return repos;
+}
+
#endif // INCLUDED_SRC_TEST_UTILS_TEST_ENV_HPP