[Test Proxy] Add error response when starting test proxy
@@ -95,6 +95,17 @@ def check_availability() -> None:
return 404
+def check_system_proxy_availability() -> None:
+ """Checks for SSL_CERT_DIR and REQUESTS_CA_BUNDLE environment variables."""
+ ssl_cert = "SSL_CERT_DIR"
+ ca_bundle = "REQUESTS_CA_BUNDLE"
+
+ if PROXY_URL.startswith("https") and not os.environ.get(ssl_cert):
+ _LOGGER.error(f"Please ensure the '{ssl_cert}' environment variable is correctly set in your test environment")
+ if PROXY_URL.startswith("https") and not os.environ.get(ca_bundle):
+ _LOGGER.error(f"Please ensure the '{ca_bundle}' environment variable is correctly set in your test environment")
+
+
def check_proxy_availability() -> None:
"""Waits for the availability of the test-proxy."""
start = time.time()
@@ -139,6 +150,7 @@ def start_test_proxy(request) -> None:
function will start the test-proxy .NET tool."""
repo_root = ascend_to_root(request.node.items[0].module.__file__)
+ check_system_proxy_availability()
if not PROXY_MANUALLY_STARTED:
if os.getenv("TF_BUILD"):
