Skip to content

Commit

Permalink
[serve] reorder tests BUILD file (#47718)
Browse files Browse the repository at this point in the history
## Why are these changes needed?

Reorder Serve tests BUILD file in a more intuitive way, and add comments
for each block of tests.

Signed-off-by: Cindy Zhang <[email protected]>
  • Loading branch information
zcin committed Sep 17, 2024
1 parent 5ca9c66 commit 17f4f38
Showing 1 changed file with 66 additions and 56 deletions.
122 changes: 66 additions & 56 deletions python/ray/serve/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,7 @@ py_test_module_list(
],
)

# Test autoscaling with RAY_SERVE_COLLECT_AUTOSCALING_METRICS_ON_HANDLE set to 0
py_test(
name = "test_autoscaling_policy_with_metr_disab",
size = "large",
srcs = ["test_autoscaling_policy.py"],
env = {"RAY_SERVE_COLLECT_AUTOSCALING_METRICS_ON_HANDLE": "0"},
main = "test_autoscaling_policy.py",
tags = [
"autoscaling",
"exclusive",
"team:serve",
],
deps = [
":common",
":conftest",
"//python/ray/serve:serve_lib",
],
)

# Medium tests, don't run on windows.
py_test_module_list(
size = "medium",
files = [
Expand Down Expand Up @@ -146,20 +128,17 @@ py_test_module_list(
],
)

# Large tests requiring `test_config_files/`.
py_test_module_list(
size = "enormous",
size = "large",
data = glob(["test_config_files/**/*"]),
files = [
"test_deploy_app.py",
"test_metrics.py",
"test_enable_task_events.py",
"test_kv_store.py",
"test_long_poll.py",
"test_regression.py",
"test_cli.py",
"test_cli_2.py",
],
tags = [
"exclusive",
"team:serve",
"use_all_core_windows",
],
deps = [
":common",
Expand All @@ -168,6 +147,7 @@ py_test_module_list(
],
)

# Large tests require `test_config_files/`, no windows.
py_test_module_list(
size = "large",
data = glob(["test_config_files/**/*"]),
Expand All @@ -186,17 +166,21 @@ py_test_module_list(
],
)

# Minimal tests
# Enormous tests.
py_test_module_list(
size = "large",
size = "enormous",
files = [
"test_api.py",
"test_model_composition.py",
"test_deploy_app.py",
"test_metrics.py",
"test_enable_task_events.py",
"test_kv_store.py",
"test_long_poll.py",
"test_regression.py",
],
tags = [
"exclusive",
"minimal",
"team:serve",
"use_all_core_windows",
],
deps = [
":common",
Expand All @@ -205,16 +189,16 @@ py_test_module_list(
],
)

# Post-wheel-build tests.
# Minimal tests
py_test_module_list(
size = "large",
files = [
"test_runtime_env.py",
"test_runtime_env_2.py",
"test_api.py",
"test_model_composition.py",
],
tags = [
"exclusive",
"post_wheel_build",
"minimal",
"team:serve",
],
deps = [
Expand All @@ -224,16 +208,16 @@ py_test_module_list(
],
)

# Tests requiring `test_config_files/`.
# Post-wheel-build tests.
py_test_module_list(
size = "large",
data = glob(["test_config_files/**/*"]),
files = [
"test_cli.py",
"test_cli_2.py",
"test_runtime_env.py",
"test_runtime_env_2.py",
],
tags = [
"exclusive",
"post_wheel_build",
"team:serve",
],
deps = [
Expand Down Expand Up @@ -263,6 +247,7 @@ py_test(
],
)

# Serve HA.
py_test(
name = "test_serve_ha",
size = "medium",
Expand All @@ -279,6 +264,27 @@ py_test(
],
)

# ----- TEST FEATURE FLAGS -----

# Test autoscaling with metrics collected from replica instead of handle.
py_test(
name = "test_autoscaling_policy_with_metr_disab",
size = "large",
srcs = ["test_autoscaling_policy.py"],
env = {"RAY_SERVE_COLLECT_AUTOSCALING_METRICS_ON_HANDLE": "0"},
main = "test_autoscaling_policy.py",
tags = [
"autoscaling",
"exclusive",
"team:serve",
],
deps = [
":common",
":conftest",
"//python/ray/serve:serve_lib",
],
)

# Tests disabling queue len caching feature flag.
# TODO(edoakes): remove this after the FF is removed.
py_test_module_list(
Expand Down Expand Up @@ -306,6 +312,7 @@ py_test_module_list(
],
)

# Tests autoscaling when queue len caching is disabled.
py_test_module_list(
size = "large",
env = {"RAY_SERVE_ENABLE_QUEUE_LENGTH_CACHE": "0"},
Expand Down Expand Up @@ -370,17 +377,23 @@ py_test_module_list(
],
)

# Test compact scheduling
# Medium tests with compact scheduling
py_test_module_list(
size = "large",
size = "medium",
data = glob(["test_config_files/**/*"]),
env = {"RAY_SERVE_USE_COMPACT_SCHEDULING_STRATEGY": "1"},
files = [
"test_standalone.py",
"test_standalone_3.py",
"test_cluster.py",
"test_controller_recovery.py",
"test_deployment_scheduler.py",
"test_gcs_failure.py",
"test_max_replicas_per_node.py",
"test_replica_placement_group.py",
],
name_suffix = "_with_comp_sche",
name_suffix = "_with_compact_scheduling",
tags = [
"exclusive",
"no_windows",
"team:serve",
],
deps = [
Expand All @@ -390,17 +403,17 @@ py_test_module_list(
],
)

# Large tests with compact scheduling
py_test_module_list(
size = "large",
data = glob(["test_config_files/**/*"]),
env = {"RAY_SERVE_USE_COMPACT_SCHEDULING_STRATEGY": "1"},
files = [
"test_standalone_2.py",
"test_standalone.py",
"test_standalone_3.py",
],
name_suffix = "_with_compact_scheduling",
name_suffix = "_with_comp_sche",
tags = [
"exclusive",
"no_windows",
"team:serve",
],
deps = [
Expand All @@ -410,17 +423,13 @@ py_test_module_list(
],
)

# Large tests with compact scheduling, no windows
py_test_module_list(
size = "medium",
size = "large",
data = glob(["test_config_files/**/*"]),
env = {"RAY_SERVE_USE_COMPACT_SCHEDULING_STRATEGY": "1"},
files = [
"test_cluster.py",
"test_controller_recovery.py",
"test_deployment_scheduler.py",
"test_gcs_failure.py",
"test_max_replicas_per_node.py",
"test_replica_placement_group.py",
"test_standalone_2.py",
],
name_suffix = "_with_compact_scheduling",
tags = [
Expand All @@ -434,3 +443,4 @@ py_test_module_list(
"//python/ray/serve:serve_lib",
],
)

0 comments on commit 17f4f38

Please sign in to comment.