Skip to content

Commit 9832caa

Browse files
sampan-s-nayaksampan
authored andcommitted
[Core] move authentication_test_utils into ray._private to fix macos tests (ray-project#58528)
the auth token test setup in `conftest.py` is breaking macos test. there are two test scripts (`test_microbenchmarks.py` and `test_basic.py`) that run after the wheel is installed but without editable mode. for these test to pass,` conftest.py` cannot import anything under `ray.tests`. this pr moves `authentication_test_utils` into `ray._private` to fix this issue Signed-off-by: sampan <sampan@anyscale.com> Co-authored-by: sampan <sampan@anyscale.com> Signed-off-by: YK <1811651+ykdojo@users.noreply.github.com>
1 parent 484c4a2 commit 9832caa

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

python/ray/tests/conftest.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
import ray._private.ray_constants as ray_constants
2525
from ray._common.network_utils import build_address, find_free_port
2626
from ray._common.test_utils import wait_for_condition
27+
from ray._private.authentication_test_utils import (
28+
authentication_env_guard,
29+
clear_auth_token_sources,
30+
reset_auth_token_state,
31+
set_auth_mode,
32+
set_env_auth_token,
33+
)
2734
from ray._private.conftest_utils import set_override_dashboard_url # noqa: F401
2835
from ray._private.runtime_env import virtualenv_utils
2936
from ray._private.test_utils import (
@@ -42,13 +49,6 @@
4249
teardown_tls,
4350
)
4451
from ray.cluster_utils import AutoscalingCluster, Cluster, cluster_not_supported
45-
from ray.tests.authentication_test_utils import (
46-
authentication_env_guard,
47-
clear_auth_token_sources,
48-
reset_auth_token_state,
49-
set_auth_mode,
50-
set_env_auth_token,
51-
)
5252

5353
import psutil
5454

python/ray/tests/test_runtime_env_agent_auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
format_authentication_http_error,
1313
get_auth_headers_if_auth_enabled,
1414
)
15-
from ray.core.generated import runtime_env_agent_pb2
16-
from ray.tests.authentication_test_utils import (
15+
from ray._private.authentication_test_utils import (
1716
reset_auth_token_state,
1817
set_auth_mode,
1918
set_env_auth_token,
2019
)
20+
from ray.core.generated import runtime_env_agent_pb2
2121

2222

2323
def _agent_url(agent_address: str, path: str) -> str:

python/ray/tests/test_submission_client_auth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
HTTP_REQUEST_INVALID_TOKEN_ERROR_MESSAGE,
55
HTTP_REQUEST_MISSING_TOKEN_ERROR_MESSAGE,
66
)
7-
from ray.dashboard.modules.dashboard_sdk import SubmissionClient
8-
from ray.dashboard.modules.job.sdk import JobSubmissionClient
9-
from ray.tests.authentication_test_utils import (
7+
from ray._private.authentication_test_utils import (
108
clear_auth_token_sources,
119
reset_auth_token_state,
1210
set_auth_mode,
1311
set_env_auth_token,
1412
)
13+
from ray.dashboard.modules.dashboard_sdk import SubmissionClient
14+
from ray.dashboard.modules.job.sdk import JobSubmissionClient
1515
from ray.util.state import StateApiClient
1616

1717

python/ray/tests/test_token_auth_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
_RAYLET_AVAILABLE = False
2020
AuthenticationTokenLoader = None
2121

22-
from ray.tests.authentication_test_utils import (
22+
from ray._private.authentication_test_utils import (
2323
clear_auth_token_sources,
2424
reset_auth_token_state,
2525
set_auth_mode,

0 commit comments

Comments
 (0)