Skip to content

Commit a7efdd5

Browse files
authored
[core] Split out runtime_env unit tests (ray-project#53477)
- Move unit tests to `unit/` directory. - Add enforcement in the `unit/` directory that Ray is never initialized. - Combine the two `test_runtime_env_validation.py` files. - Split out `test_runtime_env_get_wheel_names.py`. --------- Signed-off-by: Edward Oakes <[email protected]>
1 parent aea4eac commit a7efdd5

15 files changed

+1037
-1025
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
exclude: |
3030
(?x)^(
3131
# Intentionally bad json schema
32-
python/ray/tests/test_runtime_env_validation_bad_2_schema.json|
32+
python/ray/tests/unit/test_runtime_env_validation_bad_schema.json|
3333
# json5 comments prevent parsing
3434
python/asv.conf.json|
3535
rllib/asv.conf.json

python/ray/tests/BUILD

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ py_test_module_list(
477477
"test_raylet_output.py",
478478
"test_reconstruction_stress.py",
479479
"test_reconstruction_stress_spill.py",
480+
"test_runtime_env_get_wheel_names.py",
480481
"test_state_api_summary.py",
481482
"test_streaming_generator_regression.py",
482483
"test_system_metrics.py",
@@ -1175,25 +1176,6 @@ py_test(
11751176
],
11761177
)
11771178

1178-
py_test(
1179-
name = "test_runtime_env_validation",
1180-
size = "small",
1181-
srcs = ["test_runtime_env_validation.py"],
1182-
data = [
1183-
"test_runtime_env_validation_1_schema.json",
1184-
"test_runtime_env_validation_2_schema.json",
1185-
],
1186-
tags = [
1187-
"exclusive",
1188-
"small_size_python_tests",
1189-
"team:core",
1190-
],
1191-
deps = [
1192-
":conftest",
1193-
"//:ray_lib",
1194-
],
1195-
)
1196-
11971179
py_test(
11981180
name = "kuberay/test_autoscaling_e2e",
11991181
size = "large",

python/ray/tests/conftest.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import ray._private.ray_constants as ray_constants
2525
from ray._private.conftest_utils import set_override_dashboard_url # noqa: F401
2626
from ray._private.runtime_env import virtualenv_utils
27-
from ray._private.runtime_env.plugin_schema_manager import RuntimeEnvPluginSchemaManager
2827

2928
from ray._private.test_utils import (
3029
get_and_run_resource_killer,
@@ -1457,18 +1456,6 @@ def set_runtime_env_plugins(request):
14571456
del os.environ["RAY_RUNTIME_ENV_PLUGINS"]
14581457

14591458

1460-
@pytest.fixture
1461-
def set_runtime_env_plugin_schemas(request):
1462-
runtime_env_plugin_schemas = getattr(request, "param", "0")
1463-
try:
1464-
os.environ["RAY_RUNTIME_ENV_PLUGIN_SCHEMAS"] = runtime_env_plugin_schemas
1465-
# Clear and reload schemas.
1466-
RuntimeEnvPluginSchemaManager.clear()
1467-
yield runtime_env_plugin_schemas
1468-
finally:
1469-
del os.environ["RAY_RUNTIME_ENV_PLUGIN_SCHEMAS"]
1470-
1471-
14721459
@pytest.fixture(scope="function")
14731460
def temp_file(request):
14741461
with tempfile.NamedTemporaryFile("r+b") as fp:

0 commit comments

Comments
 (0)