Skip to content

Commit

Permalink
Revert "Revert "Bump pytest from 5.4.3 to 7.0.1"" (#26525)
Browse files Browse the repository at this point in the history
* Revert "Revert "Bump pytest from 5.4.3 to 7.0.1""

This reverts commit ab10890.

Signed-off-by: Riatre Foo <[email protected]>

* Fix missing test data files dependency in rllib/BUILD

See # 26334 and # 26517 for context.

Once this is in, it should be good to roll-forwrad again.

Signed-off-by: Riatre Foo <[email protected]>

* debug: run all tests

Signed-off-by: Riatre Foo <[email protected]>

* Revert "debug: run all tests"

This reverts commit 0c5e796.

Signed-off-by: Riatre Foo <[email protected]>

* fix new tests since last rebase

Signed-off-by: Riatre Foo <[email protected]>
  • Loading branch information
Riatre authored Jul 19, 2022
1 parent a435a04 commit 591cd22
Show file tree
Hide file tree
Showing 24 changed files with 232 additions and 110 deletions.
3 changes: 2 additions & 1 deletion bazel/python.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@bazel_skylib//lib:paths.bzl", "paths")
# py_test_module_list creates a py_test target for each
# Python file in `files`

def py_test_module_list(files, size, deps, extra_srcs, name_suffix="", **kwargs):
def py_test_module_list(files, size, deps, extra_srcs=[], name_suffix="", **kwargs):
for file in files:
# remove .py
name = paths.split_extension(file)[0] + name_suffix
Expand All @@ -14,6 +14,7 @@ def py_test_module_list(files, size, deps, extra_srcs, name_suffix="", **kwargs)
size = size,
main = file,
srcs = extra_srcs + [file],
deps = deps,
**kwargs
)

Expand Down
4 changes: 2 additions & 2 deletions ci/build/test-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if [[ "$platform" == "linux" ]]; then
"$PYTHON_EXE" -u -c "import ray; print(ray.__commit__)" | grep "$TRAVIS_COMMIT" || (echo "ray.__commit__ not set properly!" && exit 1)

# Install the dependencies to run the tests.
"$PIP_CMD" install -q aiohttp aiosignal frozenlist grpcio pytest==5.4.3 requests proxy.py
"$PIP_CMD" install -q aiohttp aiosignal frozenlist grpcio 'pytest==7.0.1' requests proxy.py

# Run a simple test script to make sure that the wheel works.
for SCRIPT in "${TEST_SCRIPTS[@]}"; do
Expand Down Expand Up @@ -117,7 +117,7 @@ elif [[ "$platform" == "macosx" ]]; then
"$PIP_CMD" install -q "$PYTHON_WHEEL"

# Install the dependencies to run the tests.
"$PIP_CMD" install -q aiohttp aiosignal frozenlist grpcio pytest==5.4.3 requests proxy.py
"$PIP_CMD" install -q aiohttp aiosignal frozenlist grpcio 'pytest==7.0.1' requests proxy.py

# Run a simple test script to make sure that the wheel works.
for SCRIPT in "${TEST_SCRIPTS[@]}"; do
Expand Down
4 changes: 2 additions & 2 deletions ci/env/install-minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ eval "${WORKSPACE_DIR}/ci/ci.sh build"

# Install test requirements
python -m pip install -U \
pytest==5.4.3 \
pytest==7.0.1 \
numpy

# Train requirements.
# TODO: make this dynamic
if [ "${TRAIN_MINIMAL_INSTALL-}" = 1 ]; then
python -m pip install -U "ray[tune]"
fi
fi
4 changes: 1 addition & 3 deletions cpp/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,5 @@ py_test_module_list(
"small_size_python_tests",
"team:core",
],
deps = [
":ray_api",
],
deps = [],
)
17 changes: 17 additions & 0 deletions dashboard/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ py_library(
),
)

py_library(
name = "conftest",
srcs = ["tests/conftest.py"],
deps = ["//python/ray/tests:conftest"],
)

py_test_run_all_subdirectory(
size = "medium",
include = ["**/test*.py"],
Expand All @@ -20,20 +26,31 @@ py_test_run_all_subdirectory(
"tests/test_state_head.py"
],
extra_srcs = [],
data = [
"modules/job/tests/backwards_compatibility_scripts/test_backwards_compatibility.sh",
"modules/job/tests/pip_install_test-0.5-py3-none-any.whl",
"modules/snapshot/snapshot_schema.json",
"modules/tests/test_config_files/basic_runtime_env.yaml",
] + glob([
"modules/job/tests/subprocess_driver_scripts/*.py",
]),
deps = [":conftest"],
tags = ["exclusive", "team:serve"],
)

py_test(
name = "test_node",
size = "medium",
srcs = ["modules/node/tests/test_node.py"],
deps = [":conftest"],
tags = ["exclusive", "team:serve"],
)

py_test(
name = "test_dashboard",
size = "medium",
srcs = ["tests/test_dashboard.py"],
deps = [":conftest"],
tags = ["exclusive", "team:serve"],
)

Expand Down
5 changes: 5 additions & 0 deletions python/ray/autoscaler/aws/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
filegroup(
name = "example",
data = glob(["example-*.yaml"]),
visibility = ["//python/ray/tests:__pkg__"],
)
5 changes: 5 additions & 0 deletions python/ray/autoscaler/azure/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
filegroup(
name = "example",
data = glob(["example-*.yaml"]),
visibility = ["//python/ray/tests:__pkg__"],
)
5 changes: 5 additions & 0 deletions python/ray/autoscaler/gcp/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
filegroup(
name = "example",
data = glob(["example-*.yaml"]),
visibility = ["//python/ray/tests:__pkg__"],
)
5 changes: 5 additions & 0 deletions python/ray/autoscaler/local/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
filegroup(
name = "example",
data = glob(["example-*.yaml"]),
visibility = ["//python/ray/tests:__pkg__"],
)
30 changes: 20 additions & 10 deletions python/ray/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,38 @@
# --------------------------------------------------------------------
load("//bazel:python.bzl", "py_test_module_list")

SRCS = [] + select({
"@bazel_tools//src/conditions:windows": glob([
"**/conftest.py",
]),
"//conditions:default": [],
})
py_library(
name = "conftest",
srcs = ["tests/conftest.py"],
deps = ["//python/ray/tests:conftest"],
)

py_test(
name = "test_preprocessors",
size = "small",
srcs = ["tests/test_preprocessors.py"],
tags = ["team:ml", "exclusive", "ray_air"],
deps = ["//:ray_lib"],
deps = ["//:ray_lib", ":conftest"],
)

py_test(
name = "test_dataset_formats",
size = "large",
srcs = ["tests/test_dataset_formats.py"],
data = glob(["tests/image-folder/**/*"]),
tags = ["team:core", "exclusive"],
deps = ["//:ray_lib", ":conftest"],
)

py_test_module_list(
files = glob(
include=["tests/test_*.py"],
exclude=["tests/test_preprocessors.py"]
exclude=[
"tests/test_preprocessors.py",
"tests/test_dataset_formats.py",
],
),
size = "large",
extra_srcs = SRCS,
tags = ["team:core", "exclusive"],
deps = ["//:ray_lib"],
deps = ["//:ray_lib", ":conftest"],
)
9 changes: 9 additions & 0 deletions python/ray/experimental/packaging/example_pkg/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
filegroup(
name = "example_pkg",
data = [
"ray_pkg.yaml",
] + glob([
"my_pkg/**/*.py",
]),
visibility = ["//python/ray/tests:__pkg__"],
)
6 changes: 6 additions & 0 deletions python/ray/serve/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ py_library(

serve_tests_srcs = glob(["tests/**/*.py"])

filegroup(
name = "test_config_files",
data = glob(["tests/test_config_files/**/*"]),
)

py_test(
name = "test_api",
size = "medium",
Expand Down Expand Up @@ -321,6 +326,7 @@ py_test(
srcs = serve_tests_srcs,
tags = ["exclusive", "team:serve"],
deps = [":serve_lib"],
data = [":test_config_files"],
)

py_test(
Expand Down
Loading

0 comments on commit 591cd22

Please sign in to comment.