@@ -206,15 +206,13 @@ prepare_docker() {
206206 popd
207207}
208208
209- # For running Python tests on Windows.
210- test_python () {
209+ # For running Serve tests on Windows.
210+ test_serve () {
211211 local pathsep=" :" args=()
212212 if [ " ${OSTYPE} " = msys ]; then
213213 pathsep=" ;"
214214 args+=(
215215 python/ray/serve/...
216- python/ray/tests/...
217- python/ray/train:test_windows
218216 -python/ray/serve/tests:test_cross_language # Ray java not built on Windows yet.
219217 -python/ray/serve/tests:test_gcs_failure # Fork not supported in windows
220218 -python/ray/serve/tests:test_standalone_2 # Multinode not supported on Windows
@@ -224,6 +222,41 @@ test_python() {
224222 -python/ray/serve/tests:test_fastapi
225223 -python/ray/serve/tests:test_get_deployment # address violation
226224 -python/ray/serve/tests:test_proxy_state # skip running on Windows until we refactor the test
225+ )
226+ fi
227+ if [ 0 -lt " ${# args[@]} " ]; then # Any targets to test?
228+ install_ray
229+
230+ # Shard the args.
231+ BUILDKITE_PARALLEL_JOB=${BUILDKITE_PARALLEL_JOB:- ' 0' }
232+ BUILDKITE_PARALLEL_JOB_COUNT=${BUILDKITE_PARALLEL_JOB_COUNT:- ' 1' }
233+ test_shard_selection=$( python ./ci/ray_ci/bazel_sharding.py --exclude_manual --index " ${BUILDKITE_PARALLEL_JOB} " --count " ${BUILDKITE_PARALLEL_JOB_COUNT} " " ${args[@]} " )
234+
235+ # TODO(mehrdadn): We set PYTHONPATH here to let Python find our pickle5 under pip install -e.
236+ # It's unclear to me if this should be necessary, but this is to make tests run for now.
237+ # Check why this issue doesn't arise on Linux/Mac.
238+ # Ideally importing ray.cloudpickle should import pickle5 automatically.
239+ # shellcheck disable=SC2046,SC2086
240+ bazel test --config=ci \
241+ --build_tests_only $( ./ci/run/bazel_export_options) \
242+ --test_env=PYTHONPATH=" ${PYTHONPATH-}${pathsep}${WORKSPACE_DIR} /python/ray/pickle5_files" \
243+ --test_env=CI=" 1" \
244+ --test_env=RAY_CI_POST_WHEEL_TESTS=" 1" \
245+ --test_env=USERPROFILE=" ${USERPROFILE} " \
246+ --test_output=streamed \
247+ -- \
248+ ${test_shard_selection} ;
249+ fi
250+ }
251+
252+ # For running Python tests on Windows (excluding Serve).
253+ test_python () {
254+ local pathsep=" :" args=()
255+ if [ " ${OSTYPE} " = msys ]; then
256+ pathsep=" ;"
257+ args+=(
258+ python/ray/tests/...
259+ python/ray/train:test_windows
227260 -python/ray/tests:test_actor_advanced # crashes in shutdown
228261 -python/ray/tests:test_autoscaler # We don't support Autoscaler on Windows
229262 -python/ray/tests:test_autoscaler_aws
0 commit comments