From c4c0deadc834cad8aeadc70ebcd04c2132ea5f5d Mon Sep 17 00:00:00 2001 From: sampan Date: Tue, 11 Nov 2025 03:14:34 +0000 Subject: [PATCH] [core] move authentication_test_utils into ray._private to fix macos tests Signed-off-by: sampan --- .../authentication_test_utils.py | 0 python/ray/tests/conftest.py | 14 +++++++------- python/ray/tests/test_runtime_env_agent_auth.py | 4 ++-- python/ray/tests/test_submission_client_auth.py | 6 +++--- python/ray/tests/test_token_auth_integration.py | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) rename python/ray/{tests => _private}/authentication_test_utils.py (100%) diff --git a/python/ray/tests/authentication_test_utils.py b/python/ray/_private/authentication_test_utils.py similarity index 100% rename from python/ray/tests/authentication_test_utils.py rename to python/ray/_private/authentication_test_utils.py diff --git a/python/ray/tests/conftest.py b/python/ray/tests/conftest.py index 03cf4308701a..068bde2b294e 100644 --- a/python/ray/tests/conftest.py +++ b/python/ray/tests/conftest.py @@ -24,6 +24,13 @@ import ray._private.ray_constants as ray_constants from ray._common.network_utils import build_address, find_free_port from ray._common.test_utils import wait_for_condition +from ray._private.authentication_test_utils import ( + authentication_env_guard, + clear_auth_token_sources, + reset_auth_token_state, + set_auth_mode, + set_env_auth_token, +) from ray._private.conftest_utils import set_override_dashboard_url # noqa: F401 from ray._private.runtime_env import virtualenv_utils from ray._private.test_utils import ( @@ -42,13 +49,6 @@ teardown_tls, ) from ray.cluster_utils import AutoscalingCluster, Cluster, cluster_not_supported -from ray.tests.authentication_test_utils import ( - authentication_env_guard, - clear_auth_token_sources, - reset_auth_token_state, - set_auth_mode, - set_env_auth_token, -) import psutil diff --git a/python/ray/tests/test_runtime_env_agent_auth.py b/python/ray/tests/test_runtime_env_agent_auth.py index 879e1c739277..6603775a3404 100644 --- a/python/ray/tests/test_runtime_env_agent_auth.py +++ b/python/ray/tests/test_runtime_env_agent_auth.py @@ -12,12 +12,12 @@ format_authentication_http_error, get_auth_headers_if_auth_enabled, ) -from ray.core.generated import runtime_env_agent_pb2 -from ray.tests.authentication_test_utils import ( +from ray._private.authentication_test_utils import ( reset_auth_token_state, set_auth_mode, set_env_auth_token, ) +from ray.core.generated import runtime_env_agent_pb2 def _agent_url(agent_address: str, path: str) -> str: diff --git a/python/ray/tests/test_submission_client_auth.py b/python/ray/tests/test_submission_client_auth.py index 33c63ac7d93c..0d500bcc68da 100644 --- a/python/ray/tests/test_submission_client_auth.py +++ b/python/ray/tests/test_submission_client_auth.py @@ -4,14 +4,14 @@ HTTP_REQUEST_INVALID_TOKEN_ERROR_MESSAGE, HTTP_REQUEST_MISSING_TOKEN_ERROR_MESSAGE, ) -from ray.dashboard.modules.dashboard_sdk import SubmissionClient -from ray.dashboard.modules.job.sdk import JobSubmissionClient -from ray.tests.authentication_test_utils import ( +from ray._private.authentication_test_utils import ( clear_auth_token_sources, reset_auth_token_state, set_auth_mode, set_env_auth_token, ) +from ray.dashboard.modules.dashboard_sdk import SubmissionClient +from ray.dashboard.modules.job.sdk import JobSubmissionClient from ray.util.state import StateApiClient diff --git a/python/ray/tests/test_token_auth_integration.py b/python/ray/tests/test_token_auth_integration.py index d68f3594b47f..191f836164a7 100644 --- a/python/ray/tests/test_token_auth_integration.py +++ b/python/ray/tests/test_token_auth_integration.py @@ -19,7 +19,7 @@ _RAYLET_AVAILABLE = False AuthenticationTokenLoader = None -from ray.tests.authentication_test_utils import ( +from ray._private.authentication_test_utils import ( clear_auth_token_sources, reset_auth_token_state, set_auth_mode,