mirror of
https://github.com/wassname/ray.git
synced 2026-07-25 13:30:52 +08:00
Moving tests from test/ to python/ray/tests/ (#3950)
This commit is contained in:
committed by
Robert Nishihara
parent
acbe0b4e5f
commit
c7a4c74f55
+50
-47
@@ -26,14 +26,14 @@ matrix:
|
||||
- JDK='Oracle JDK 8'
|
||||
- PYTHON=3.5 PYTHONWARNINGS=ignore
|
||||
install:
|
||||
- ./.travis/install-dependencies.sh
|
||||
- ./ci/travis/install-dependencies.sh
|
||||
- export PATH="$HOME/miniconda/bin:$PATH"
|
||||
script:
|
||||
- ./java/test.sh
|
||||
|
||||
# Test Bazel build
|
||||
- rm -rf build
|
||||
- ./.travis/install-bazel.sh
|
||||
- ./ci/travis/install-bazel.sh
|
||||
- bazel build ...
|
||||
|
||||
- os: linux
|
||||
@@ -47,10 +47,10 @@ matrix:
|
||||
- sudo apt-get install -qq clang-format-3.8
|
||||
install: []
|
||||
script:
|
||||
- .travis/check-git-clang-format-output.sh
|
||||
- ./ci/travis/check-git-clang-format-output.sh
|
||||
# Try generating Sphinx documentation. To do this, we need to install
|
||||
# Ray first.
|
||||
- ./.travis/install-dependencies.sh
|
||||
- ./ci/travis/install-dependencies.sh
|
||||
- export PATH="$HOME/miniconda/bin:$PATH"
|
||||
- cd doc
|
||||
- pip install -q -r requirements-doc.txt
|
||||
@@ -59,7 +59,7 @@ matrix:
|
||||
- cd ..
|
||||
# Run Python linting, ignore dict vs {} (C408), others are defaults
|
||||
- flake8 --exclude=python/ray/core/generated/,doc/source/conf.py,python/ray/cloudpickle/ --ignore=C408,E121,E123,E126,E226,E24,E704,W503,W504,W605
|
||||
- .travis/format.sh --all
|
||||
- ./ci/travis/format.sh --all
|
||||
# Make sure that the README is formatted properly.
|
||||
- cd python
|
||||
- python setup.py check --restructuredtext --strict --metadata
|
||||
@@ -72,7 +72,7 @@ matrix:
|
||||
- export GOPATH="$HOME/go_dir"
|
||||
- export PATH="$GOROOT/bin:$GOPATH/bin:$PATH"
|
||||
- go get github.com/bazelbuild/buildtools/buildifier
|
||||
- ./.travis/bazel-format.sh
|
||||
- ./ci/travis/bazel-format.sh
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
@@ -81,10 +81,10 @@ matrix:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq valgrind
|
||||
install:
|
||||
- ./.travis/install-dependencies.sh
|
||||
- ./ci/travis/install-dependencies.sh
|
||||
- export PATH="$HOME/miniconda/bin:$PATH"
|
||||
- ./.travis/install-ray.sh
|
||||
- ./.travis/install-with-cache-libs.sh
|
||||
- ./ci/travis/install-ray.sh
|
||||
- ./ci/travis/install-with-cache-libs.sh
|
||||
|
||||
script:
|
||||
- cd build
|
||||
@@ -98,10 +98,10 @@ matrix:
|
||||
|
||||
# # Python3.5+ only. Otherwise we will get `SyntaxError` regardless of how we set the tester.
|
||||
- python -c 'import sys;exit(sys.version_info>=(3,5))' || python -m pytest -v --durations=10 python/ray/experimental/test/async_test.py
|
||||
- python -m pytest -v --durations=10 test/mini_test.py
|
||||
- python -m pytest -v --durations=10 test/array_test.py
|
||||
- python -m pytest -v --durations=10 test/multi_node_test_2.py
|
||||
- python -m pytest -v --durations=10 test/node_manager_test.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_mini.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_array.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_multi_node_2.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_node_manager.py
|
||||
|
||||
|
||||
# Build Linux wheels.
|
||||
@@ -109,22 +109,22 @@ matrix:
|
||||
dist: trusty
|
||||
env: LINUX_WHEELS=1 PYTHONWARNINGS=ignore
|
||||
install:
|
||||
- ./.travis/install-dependencies.sh
|
||||
- ./ci/travis/install-dependencies.sh
|
||||
# This command should be kept in sync with ray/python/README-building-wheels.md.
|
||||
- docker run --rm -w /ray -v `pwd`:/ray -ti quay.io/xhochy/arrow_manylinux1_x86_64_base:latest /ray/python/build-wheel-manylinux1.sh
|
||||
script:
|
||||
- ./.travis/test-wheels.sh
|
||||
- ./ci/travis/test-wheels.sh
|
||||
|
||||
# Build MacOS wheels.
|
||||
- os: osx
|
||||
osx_image: xcode7
|
||||
env: MAC_WHEELS=1 PYTHONWARNINGS=ignore
|
||||
install:
|
||||
- ./.travis/install-dependencies.sh
|
||||
- ./ci/travis/install-dependencies.sh
|
||||
# This command should be kept in sync with ray/python/README-building-wheels.md.
|
||||
- ./python/build-wheel-macos.sh
|
||||
script:
|
||||
- ./.travis/test-wheels.sh
|
||||
- ./ci/travis/test-wheels.sh
|
||||
|
||||
# Test GCS integration
|
||||
- os: linux
|
||||
@@ -136,10 +136,10 @@ matrix:
|
||||
|
||||
|
||||
install:
|
||||
- ./.travis/install-dependencies.sh
|
||||
- ./ci/travis/install-dependencies.sh
|
||||
- export PATH="$HOME/miniconda/bin:$PATH"
|
||||
- ./.travis/install-ray.sh
|
||||
- ./.travis/install-cython-examples.sh
|
||||
- ./ci/travis/install-ray.sh
|
||||
- ./ci/travis/install-cython-examples.sh
|
||||
|
||||
- cd build
|
||||
- bash ../src/ray/test/run_gcs_tests.sh
|
||||
@@ -162,7 +162,7 @@ script:
|
||||
# class definitions: The main module of tests that are run
|
||||
# with pytest have the same name as the test file -- and this
|
||||
# module is only found if the test directory is in the PYTHONPATH.
|
||||
- export PYTHONPATH="$PYTHONPATH:./test/"
|
||||
# - export PYTHONPATH="$PYTHONPATH:./ci/"
|
||||
|
||||
# ray tune tests
|
||||
- python python/ray/tune/test/dependency_test.py
|
||||
@@ -182,43 +182,46 @@ script:
|
||||
# Python3.5+ only. Otherwise we will get `SyntaxError` regardless of how we set the tester.
|
||||
- python -c 'import sys;exit(sys.version_info>=(3,5))' || python -m pytest -v --durations=10 python/ray/experimental/test/async_test.py
|
||||
|
||||
- python -m pytest -v --durations=10 python/ray/test/test_global_state.py
|
||||
- python -m pytest -v --durations=10 python/ray/test/test_queue.py
|
||||
- python -m pytest -v --durations=10 python/ray/test/test_ray_init.py
|
||||
- python -m pytest -v --durations=10 test/mini_test.py
|
||||
# ray tests
|
||||
# TODO(williamma12): We cannot use pytests built-in test discovery because
|
||||
# it causes a lot of the tests to fail on travis' apple builds even though
|
||||
# it runs without issue on an apple build locally.
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_global_state.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_queue.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_ray_init.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_mini.py
|
||||
|
||||
- python -m pytest -v --durations=10 test/runtest.py
|
||||
- python -m pytest -v --durations=10 test/array_test.py
|
||||
- python -m pytest -v --durations=10 test/actor_test.py
|
||||
- python -m pytest -v --durations=10 test/autoscaler_test.py
|
||||
- python -m pytest -v --durations=10 test/tensorflow_test.py
|
||||
- python -m pytest -v --durations=10 test/failure_test.py
|
||||
- python -m pytest -v --durations=10 test/microbenchmarks.py
|
||||
- python -m pytest -v --durations=10 test/stress_tests.py
|
||||
- python -m pytest -v --durations=10 test/component_failures_test.py
|
||||
- python -m pytest -v --durations=10 test/multi_node_test.py
|
||||
- python -m pytest -v --durations=10 test/multi_node_test_2.py
|
||||
- python -m pytest -v --durations=10 test/recursion_test.py
|
||||
- python -m pytest -v --durations=10 test/monitor_test.py
|
||||
- python -m pytest -v --durations=10 test/cython_test.py
|
||||
- python -m pytest -v --durations=10 test/credis_test.py
|
||||
- python -m pytest -v --durations=10 test/node_manager_test.py
|
||||
- python -m pytest -v --durations=10 test/test_signal.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_basic.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_array.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_actor.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_autoscaler.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_tensorflow.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_failure.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_microbenchmarks.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_stress.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_component_failures.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_multi_node.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_multi_node_2.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_recursion.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_monitors.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_cython.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_credis.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_node_manager.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_signal.py
|
||||
# TODO(yuhguo): object_manager_test.py requires a lot of CPU/memory, and
|
||||
# better be put in Jenkins. However, it fails frequently in Jenkins, but
|
||||
# works well in Travis. We should consider moving it back to Jenkins once
|
||||
# we figure out the reason.
|
||||
- python -m pytest -v --durations=10 test/object_manager_test.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_object_manager.py
|
||||
|
||||
# ray temp file tests
|
||||
- python -m pytest -v --durations=10 test/tempfile_test.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_tempfile.py
|
||||
|
||||
# ray debug tools tests
|
||||
- python -m pytest -v --durations=10 test/debug_tools_test.py
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_debug_tools.py
|
||||
|
||||
# modin test files
|
||||
- python -m pytest -v --durations=10 python/ray/test/test_modin.py
|
||||
|
||||
- python -m pytest -v --durations=10 python/ray/tests/test_modin.py
|
||||
deploy:
|
||||
- provider: s3
|
||||
access_key_id: AKIAJ2L7XDUSZVTXI5QA
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ import os
|
||||
import time
|
||||
|
||||
import ray
|
||||
from ray.test.test_utils import (_wait_for_nodes_to_join, _broadcast_event,
|
||||
_wait_for_event)
|
||||
from ray.tests.utils import (_wait_for_nodes_to_join, _broadcast_event,
|
||||
_wait_for_event)
|
||||
|
||||
# This test should be run with 5 nodes, which have 0, 0, 5, 6, and 50 GPUs for
|
||||
# a total of 61 GPUs. It should be run with a large number of drivers (e.g.,
|
||||
+2
-2
@@ -6,8 +6,8 @@ import os
|
||||
import time
|
||||
|
||||
import ray
|
||||
from ray.test.test_utils import (_wait_for_nodes_to_join, _broadcast_event,
|
||||
_wait_for_event, wait_for_pid_to_exit)
|
||||
from ray.tests.utils import (_wait_for_nodes_to_join, _broadcast_event,
|
||||
_wait_for_event, wait_for_pid_to_exit)
|
||||
|
||||
# This test should be run with 5 nodes, which have 0, 1, 2, 3, and 4 GPUs for a
|
||||
# total of 10 GPUs. It should be run with 7 drivers. Drivers 2 through 6 must
|
||||
@@ -43,7 +43,7 @@ while [[ $# > 0 ]]; do
|
||||
shift
|
||||
done
|
||||
|
||||
pushd $ROOT_DIR/..
|
||||
pushd $ROOT_DIR/../..
|
||||
BAZEL_FILES="bazel/BUILD bazel/BUILD.plasma bazel/ray.bzl BUILD.bazel WORKSPACE"
|
||||
buildifier -mode=$RUN_TYPE -diff_command="diff -u" $BAZEL_FILES
|
||||
buildifier -mode=$RUN_TYPE -diff_command="diff -u" $BAZEL_FILES
|
||||
popd
|
||||
+1
-1
@@ -8,7 +8,7 @@ else
|
||||
base_commit="$TRAVIS_BRANCH"
|
||||
echo "Running clang-format against branch $base_commit, with hash $(git rev-parse $base_commit)"
|
||||
fi
|
||||
output="$(.travis/git-clang-format --binary clang-format-3.8 --commit $base_commit --diff --exclude '(.*thirdparty/|.*redismodule.h|.*.js)')"
|
||||
output="$(ci/travis/git-clang-format --binary clang-format-3.8 --commit $base_commit --diff --exclude '(.*thirdparty/|.*redismodule.h|.*.js)')"
|
||||
if [ "$output" == "no modified files to format" ] || [ "$output" == "clang-format did not modify any files" ] ; then
|
||||
echo "clang-format passed."
|
||||
exit 0
|
||||
@@ -7,7 +7,7 @@ ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
|
||||
|
||||
echo "PYTHON is $PYTHON"
|
||||
|
||||
cython_examples="$ROOT_DIR/../examples/cython"
|
||||
cython_examples="$ROOT_DIR/../../examples/cython"
|
||||
|
||||
if [[ "$PYTHON" == "2.7" ]]; then
|
||||
|
||||
@@ -9,21 +9,21 @@ echo "PYTHON is $PYTHON"
|
||||
|
||||
if [[ "$PYTHON" == "2.7" ]]; then
|
||||
|
||||
pushd "$ROOT_DIR/../python"
|
||||
pushd "$ROOT_DIR/../../python"
|
||||
python setup.py install --user
|
||||
popd
|
||||
|
||||
elif [[ "$PYTHON" == "3.5" ]]; then
|
||||
export PATH="$HOME/miniconda/bin:$PATH"
|
||||
|
||||
pushd "$ROOT_DIR/../python"
|
||||
pushd "$ROOT_DIR/../../python"
|
||||
python setup.py install --user
|
||||
popd
|
||||
|
||||
elif [[ "$LINT" == "1" ]]; then
|
||||
export PATH="$HOME/miniconda/bin:$PATH"
|
||||
|
||||
pushd "$ROOT_DIR/../python"
|
||||
pushd "$ROOT_DIR/../../python"
|
||||
python setup.py install --user
|
||||
popd
|
||||
|
||||
@@ -7,15 +7,15 @@ ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
|
||||
|
||||
# Copy the libs to thirdparty/external_project_libs.
|
||||
# -n means do not build again.
|
||||
bash $ROOT_DIR/../thirdparty/scripts/collect_dependent_libs.sh -n
|
||||
bash $ROOT_DIR/../../thirdparty/scripts/collect_dependent_libs.sh -n
|
||||
|
||||
# Import all the libs cached in local to environment variables.
|
||||
source $ROOT_DIR/../thirdparty/external_project_libs/resource.txt
|
||||
source $ROOT_DIR/../../thirdparty/external_project_libs/resource.txt
|
||||
|
||||
# Clean the arrow building libs and use the cache libs.
|
||||
pushd $ROOT_DIR/../build/external/arrow/src/arrow_ep
|
||||
pushd $ROOT_DIR/../../build/external/arrow/src/arrow_ep
|
||||
echo "Clean Arrow building files."
|
||||
rm -rf $ROOT_DIR/../build/external/arrow/src/arrow_ep-build/
|
||||
rm -rf $ROOT_DIR/../../build/external/arrow/src/arrow_ep-build/
|
||||
popd
|
||||
|
||||
# Rebuild ray with libs cache environment variables, which is fast.
|
||||
@@ -21,7 +21,7 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TEST_SCRIPT=$ROOT_DIR/../test/microbenchmarks.py
|
||||
TEST_SCRIPT=$ROOT_DIR/../../python/ray/tests/test_microbenchmarks.py
|
||||
|
||||
if [[ "$platform" == "linux" ]]; then
|
||||
# First test Python 2.7.
|
||||
@@ -31,7 +31,7 @@ if [[ "$platform" == "linux" ]]; then
|
||||
bash miniconda2.sh -b -p $HOME/miniconda2
|
||||
|
||||
# Find the right wheel by grepping for the Python version.
|
||||
PYTHON_WHEEL=$(find $ROOT_DIR/../.whl -type f -maxdepth 1 -print | grep -m1 '27')
|
||||
PYTHON_WHEEL=$(find $ROOT_DIR/../../.whl -type f -maxdepth 1 -print | grep -m1 '27')
|
||||
|
||||
# Install the wheel.
|
||||
$HOME/miniconda2/bin/pip install $PYTHON_WHEEL
|
||||
@@ -46,7 +46,7 @@ if [[ "$platform" == "linux" ]]; then
|
||||
bash miniconda3.sh -b -p $HOME/miniconda3
|
||||
|
||||
# Find the right wheel by grepping for the Python version.
|
||||
PYTHON_WHEEL=$(find $ROOT_DIR/../.whl -type f -maxdepth 1 -print | grep -m1 '36')
|
||||
PYTHON_WHEEL=$(find $ROOT_DIR/../../.whl -type f -maxdepth 1 -print | grep -m1 '36')
|
||||
|
||||
# Install the wheel.
|
||||
$HOME/miniconda3/bin/pip install $PYTHON_WHEEL
|
||||
@@ -55,7 +55,7 @@ if [[ "$platform" == "linux" ]]; then
|
||||
$HOME/miniconda3/bin/python $TEST_SCRIPT
|
||||
|
||||
# Check that the other wheels are present.
|
||||
NUMBER_OF_WHEELS=$(ls -1q $ROOT_DIR/../.whl/*.whl | wc -l)
|
||||
NUMBER_OF_WHEELS=$(ls -1q $ROOT_DIR/../../.whl/*.whl | wc -l)
|
||||
if [[ "$NUMBER_OF_WHEELS" != "5" ]]; then
|
||||
echo "Wrong number of wheels found."
|
||||
ls -l $ROOT_DIR/../.whl/
|
||||
@@ -84,7 +84,7 @@ elif [[ "$platform" == "macosx" ]]; then
|
||||
PIP_CMD="$(dirname $PYTHON_EXE)/pip$PY_MM"
|
||||
|
||||
# Find the appropriate wheel by grepping for the Python version.
|
||||
PYTHON_WHEEL=$(find $ROOT_DIR/../.whl -type f -maxdepth 1 -print | grep -m1 "$PY_WHEEL_VERSION")
|
||||
PYTHON_WHEEL=$(find $ROOT_DIR/../../.whl -type f -maxdepth 1 -print | grep -m1 "$PY_WHEEL_VERSION")
|
||||
|
||||
# Install the wheel.
|
||||
$PIP_CMD install $PYTHON_WHEEL
|
||||
@@ -8,7 +8,7 @@ import argparse
|
||||
import yaml
|
||||
|
||||
import ray
|
||||
from ray.test.cluster_utils import Cluster
|
||||
from ray.tests.cluster_utils import Cluster
|
||||
from ray.tune.config_parser import make_parser
|
||||
from ray.tune.trial import resources_to_json
|
||||
from ray.tune.tune import _make_scheduler, run_experiments
|
||||
|
||||
@@ -14,8 +14,8 @@ import time
|
||||
|
||||
import ray
|
||||
import ray.ray_constants as ray_constants
|
||||
import ray.test.test_utils
|
||||
import ray.test.cluster_utils
|
||||
import ray.tests.utils
|
||||
import ray.tests.cluster_utils
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -44,7 +44,7 @@ def shutdown_only():
|
||||
|
||||
@pytest.fixture()
|
||||
def ray_start_cluster():
|
||||
cluster = ray.test.cluster_utils.Cluster()
|
||||
cluster = ray.tests.cluster_utils.Cluster()
|
||||
yield cluster
|
||||
|
||||
# The code after the yield will run as teardown code.
|
||||
@@ -58,7 +58,7 @@ def two_node_cluster():
|
||||
"initial_reconstruction_timeout_milliseconds": 200,
|
||||
"num_heartbeats_timeout": 10,
|
||||
})
|
||||
cluster = ray.test.cluster_utils.Cluster()
|
||||
cluster = ray.tests.cluster_utils.Cluster()
|
||||
for _ in range(2):
|
||||
remote_node = cluster.add_node(
|
||||
num_cpus=1, _internal_config=internal_config)
|
||||
@@ -73,7 +73,7 @@ def two_node_cluster():
|
||||
@pytest.fixture
|
||||
def head_node_cluster(request):
|
||||
timeout = getattr(request, "param", 200)
|
||||
cluster = ray.test.cluster_utils.Cluster(
|
||||
cluster = ray.tests.cluster_utils.Cluster(
|
||||
initialize_head=True,
|
||||
connect=True,
|
||||
head_node_args={
|
||||
@@ -418,7 +418,7 @@ def test_actor_class_name(ray_start_regular):
|
||||
assert len(actor_keys) == 1
|
||||
actor_class_info = r.hgetall(actor_keys[0])
|
||||
assert actor_class_info[b"class_name"] == b"Foo"
|
||||
assert actor_class_info[b"module"] == b"actor_test"
|
||||
assert actor_class_info[b"module"] == b"ray.tests.test_actor"
|
||||
|
||||
|
||||
def test_multiple_return_values(ray_start_regular):
|
||||
@@ -483,13 +483,13 @@ def test_actor_deletion(ray_start_regular):
|
||||
a = Actor.remote()
|
||||
pid = ray.get(a.getpid.remote())
|
||||
a = None
|
||||
ray.test.test_utils.wait_for_pid_to_exit(pid)
|
||||
ray.tests.utils.wait_for_pid_to_exit(pid)
|
||||
|
||||
actors = [Actor.remote() for _ in range(10)]
|
||||
pids = ray.get([a.getpid.remote() for a in actors])
|
||||
a = None
|
||||
actors = None
|
||||
[ray.test.test_utils.wait_for_pid_to_exit(pid) for pid in pids]
|
||||
[ray.tests.utils.wait_for_pid_to_exit(pid) for pid in pids]
|
||||
|
||||
@ray.remote
|
||||
class Actor(object):
|
||||
@@ -10,7 +10,7 @@ import sys
|
||||
import ray
|
||||
import ray.experimental.array.remote as ra
|
||||
import ray.experimental.array.distributed as da
|
||||
import ray.test.cluster_utils
|
||||
import ray.tests.cluster_utils
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
from importlib import reload
|
||||
@@ -75,7 +75,7 @@ def ray_start_two_nodes():
|
||||
]:
|
||||
reload(module)
|
||||
# Start the Ray processes.
|
||||
cluster = ray.test.cluster_utils.Cluster()
|
||||
cluster = ray.tests.cluster_utils.Cluster()
|
||||
for _ in range(2):
|
||||
cluster.add_node(num_cpus=10)
|
||||
ray.init(redis_address=cluster.redis_address)
|
||||
@@ -25,8 +25,8 @@ import pickle
|
||||
import pytest
|
||||
|
||||
import ray
|
||||
import ray.test.cluster_utils
|
||||
import ray.test.test_utils
|
||||
import ray.tests.cluster_utils
|
||||
import ray.tests.utils
|
||||
from ray.utils import _random_string
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -1139,7 +1139,7 @@ def test_profiling_api(shutdown_only):
|
||||
|
||||
@pytest.fixture()
|
||||
def ray_start_cluster():
|
||||
cluster = ray.test.cluster_utils.Cluster()
|
||||
cluster = ray.tests.cluster_utils.Cluster()
|
||||
yield cluster
|
||||
|
||||
# The code after the yield will run as teardown code.
|
||||
@@ -2281,7 +2281,7 @@ def test_max_call_tasks(shutdown_only):
|
||||
return os.getpid()
|
||||
|
||||
pid = ray.get(f.remote())
|
||||
ray.test.test_utils.wait_for_pid_to_exit(pid)
|
||||
ray.tests.utils.wait_for_pid_to_exit(pid)
|
||||
|
||||
@ray.remote(max_calls=2)
|
||||
def f():
|
||||
@@ -2290,7 +2290,7 @@ def test_max_call_tasks(shutdown_only):
|
||||
pid1 = ray.get(f.remote())
|
||||
pid2 = ray.get(f.remote())
|
||||
assert pid1 == pid2
|
||||
ray.test.test_utils.wait_for_pid_to_exit(pid1)
|
||||
ray.tests.utils.wait_for_pid_to_exit(pid1)
|
||||
|
||||
|
||||
def attempt_to_load_balance(remote_function,
|
||||
@@ -2443,9 +2443,9 @@ def test_global_state_api(shutdown_only):
|
||||
assert task_spec["DriverID"] == driver_id
|
||||
assert task_spec["ReturnObjectIDs"] == [result_id]
|
||||
function_table_entry = function_table[task_spec["FunctionID"]]
|
||||
assert function_table_entry["Name"] == "runtest.f"
|
||||
assert function_table_entry["Name"] == "ray.tests.test_basic.f"
|
||||
assert function_table_entry["DriverID"] == driver_id
|
||||
assert function_table_entry["Module"] == "runtest"
|
||||
assert function_table_entry["Module"] == "ray.tests.test_basic"
|
||||
|
||||
assert task_table[task_id] == ray.global_state.task_table(task_id)
|
||||
|
||||
@@ -2722,7 +2722,8 @@ def test_ray_setproctitle(shutdown_only):
|
||||
|
||||
@ray.remote
|
||||
def unique_1():
|
||||
assert setproctitle.getproctitle() == "ray_worker:runtest.unique_1()"
|
||||
assert setproctitle.getproctitle(
|
||||
) == "ray_worker:ray.tests.test_basic.unique_1()"
|
||||
|
||||
actor = UniqueName.remote()
|
||||
ray.get(actor.f.remote())
|
||||
@@ -13,8 +13,8 @@ import pytest
|
||||
|
||||
import ray
|
||||
import ray.ray_constants as ray_constants
|
||||
from ray.test.cluster_utils import Cluster
|
||||
from ray.test.test_utils import run_string_as_driver_nonblocking
|
||||
from ray.tests.cluster_utils import Cluster
|
||||
from ray.tests.utils import run_string_as_driver_nonblocking
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -16,7 +16,7 @@ import redis
|
||||
import ray
|
||||
import ray.ray_constants as ray_constants
|
||||
from ray.utils import _random_string
|
||||
from ray.test.cluster_utils import Cluster
|
||||
from ray.tests.cluster_utils import Cluster
|
||||
|
||||
|
||||
def relevant_errors(error_type):
|
||||
@@ -11,7 +11,7 @@ except ImportError:
|
||||
import time
|
||||
|
||||
import ray
|
||||
from ray.test.cluster_utils import Cluster
|
||||
from ray.tests.cluster_utils import Cluster
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -10,7 +10,7 @@ import time
|
||||
|
||||
import ray
|
||||
|
||||
from ray.test.test_utils import run_and_get_output
|
||||
from ray.tests.utils import run_and_get_output
|
||||
|
||||
|
||||
def _test_cleanup_on_driver_exit(num_redis_shards):
|
||||
@@ -8,8 +8,8 @@ import subprocess
|
||||
import time
|
||||
|
||||
import ray
|
||||
from ray.test.test_utils import (run_and_get_output, run_string_as_driver,
|
||||
run_string_as_driver_nonblocking)
|
||||
from ray.tests.utils import (run_and_get_output, run_string_as_driver,
|
||||
run_string_as_driver_nonblocking)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -9,7 +9,7 @@ import time
|
||||
|
||||
import ray
|
||||
import ray.ray_constants as ray_constants
|
||||
from ray.test.cluster_utils import Cluster
|
||||
from ray.tests.cluster_utils import Cluster
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -5,8 +5,8 @@ from __future__ import print_function
|
||||
import pytest
|
||||
|
||||
import ray
|
||||
from ray.test.cluster_utils import Cluster
|
||||
from ray.test.test_utils import run_string_as_driver
|
||||
from ray.tests.cluster_utils import Cluster
|
||||
from ray.tests.utils import run_string_as_driver
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
@@ -11,7 +11,7 @@ import time
|
||||
import warnings
|
||||
|
||||
import ray
|
||||
from ray.test.cluster_utils import Cluster
|
||||
from ray.tests.cluster_utils import Cluster
|
||||
|
||||
if (multiprocessing.cpu_count() < 40
|
||||
or ray.utils.get_system_memory() < 50 * 10**9):
|
||||
@@ -7,7 +7,7 @@ import pytest
|
||||
import redis
|
||||
|
||||
import ray
|
||||
from ray.test.cluster_utils import Cluster
|
||||
from ray.tests.cluster_utils import Cluster
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -6,9 +6,21 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import pytest
|
||||
|
||||
import ray
|
||||
|
||||
ray.init(num_cpus=1)
|
||||
|
||||
@pytest.fixture
|
||||
def ray_start():
|
||||
# Start ray instance
|
||||
ray.init(num_cpus=1)
|
||||
|
||||
# Run test using this fixture
|
||||
yield None
|
||||
|
||||
# Shutdown ray instance
|
||||
ray.shutdown()
|
||||
|
||||
|
||||
@ray.remote
|
||||
@@ -18,7 +30,7 @@ def factorial(n):
|
||||
return n * ray.get(factorial.remote(n - 1))
|
||||
|
||||
|
||||
def test_recursion():
|
||||
def test_recursion(ray_start):
|
||||
assert ray.get(factorial.remote(0)) == 1
|
||||
assert ray.get(factorial.remote(1)) == 1
|
||||
assert ray.get(factorial.remote(2)) == 2
|
||||
@@ -9,7 +9,7 @@ import pytest
|
||||
import time
|
||||
|
||||
import ray
|
||||
from ray.test.cluster_utils import Cluster
|
||||
from ray.tests.cluster_utils import Cluster
|
||||
import ray.ray_constants as ray_constants
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ except ImportError:
|
||||
import ray
|
||||
from ray import tune
|
||||
from ray.rllib import _register_all
|
||||
from ray.test.cluster_utils import Cluster
|
||||
from ray.test.test_utils import run_string_as_driver_nonblocking
|
||||
from ray.tests.cluster_utils import Cluster
|
||||
from ray.tests.utils import run_string_as_driver_nonblocking
|
||||
from ray.tune.error import TuneError
|
||||
from ray.tune.experiment import Experiment
|
||||
from ray.tune.trial import Trial
|
||||
|
||||
Reference in New Issue
Block a user