Fix modin test (#4069)

This commit is contained in:
Philipp Moritz 2019-02-18 12:17:36 -08:00 committed by Robert Nishihara
parent 6e46d75554
commit cfc7e2c5a9
3 changed files with 32 additions and 4 deletions

View file

@ -217,7 +217,7 @@ script:
- python -m pytest -v --durations=10 test/debug_tools_test.py
# modin test files
- python python/ray/test/test_modin.py
- python -m pytest -v --durations=10 python/ray/test/test_modin.py
deploy:
- provider: s3

View file

@ -2,10 +2,30 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import ray # noqa F401
import pytest
import ray
def test_modin_import():
@pytest.fixture
def shutdown_only():
yield None
# The code after the yield will run as teardown code.
ray.shutdown()
def test_modin_import_with_ray_init(shutdown_only):
ray.init(num_cpus=1)
import modin.pandas as pd
frame_data = [1, 2, 3, 4, 5, 6, 7, 8]
frame = pd.DataFrame(frame_data)
assert frame.sum().squeeze() == sum(frame_data)
# The following can be activated once we have a modin release that
# includes https://github.com/modin-project/modin/pull/472.
@pytest.mark.skip(reason="needs #472 in modin")
def test_modin_import(shutdown_only):
import modin.pandas as pd
frame_data = [1, 2, 3, 4, 5, 6, 7, 8]
frame = pd.DataFrame(frame_data)

View file

@ -84,7 +84,13 @@ class build_ext(_build_ext.build_ext):
for name in filenames:
pyarrow_files.append(os.path.join(root, name))
files_to_include = ray_files + pyarrow_files
# Make sure the relevant files for modin get copied.
modin_files = []
for (root, dirs, filenames) in os.walk("./ray/modin"):
for name in filenames:
modin_files.append(os.path.join(root, name))
files_to_include = ray_files + pyarrow_files + modin_files
# Copy over the autogenerated flatbuffer Python bindings.
for directory in generated_python_directories:
@ -144,6 +150,8 @@ requires = [
"redis",
# The six module is required by pyarrow.
"six >= 1.0.0",
# The typing module is required by modin.
"typing",
"flatbuffers",
"faulthandler;python_version<'3.3'",
]