Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert "Bump pytest from 5.4.3 to 7.0.1"" #26525

Merged
merged 6 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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__"],
)
16 changes: 7 additions & 9 deletions python/ray/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@
# --------------------------------------------------------------------
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_module_list(
Expand All @@ -26,7 +25,6 @@ py_test_module_list(
exclude=["tests/test_preprocessors.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