ray/bazel
Riatre 2cdb76789e
Bump pytest from 5.4.3 to 7.0.1 (#26334)
See #23676 for context. This is another attempt at that as I figured out what's going wrong in `bazel test`. Supersedes #24828.

Now that there are Python 3.10 wheels for Ray 1.13 and this is no longer a blocker for supporting Python 3.10, I still want to make `bazel test //python/ray/tests/...` work for developing in a 3.10 env, and make it easier to add Python 3.10 tests to CI in future.

The change contains three commits with rather descriptive commit message, which I repeat here:

Pass deps to py_test in py_test_module_list

    Bazel macro py_test_module_list takes a `deps` argument, but completely
    ignores it instead of passes it to `native.py_test`. Fixing that as we
    are going to use deps of py_test_module_list in BUILD in later changes.

    cpp/BUILD.bazel depends on the broken behaviour: it deps-on a cc_library
    from a py_test, which isn't working, see upstream issue:
    https://github.com/bazelbuild/bazel/issues/701.
    This is fixed by simply removing the (non-working) deps.

Depend on conftest and data files in Python tests BUILD files

    Bazel requires that all the files used in a test run should be
    represented in the transitive dependencies specified for the test
    target. For py_test, it means srcs, deps and data.

    Bazel enforces this constraint by creating a "runfiles" directory,
    symbolic links files in the dependency closure and run the test in the
    "runfiles" directory, so that the test shouldn't see files not in the
    dependency graph.

    Unfortunately, the constraint does not apply for a large number of
    Python tests, due to pytest (>=3.9.0, <6.0) resolving these symbolic
    links during test collection and effectively "breaks out" of the
    runfiles tree.

    pytest >= 6.0 introduces a breaking change and removed the symbolic link
    resolving behaviour, see pytest pull request
    https://github.com/pytest-dev/pytest/pull/6523 for more context.

    Currently, we are underspecifying dependencies in a lot of BUILD files
    and thus blocking us from updating to newer pytest (for Python 3.10
    support). This change hopefully fixes all of them, and at least those in
    CI, by adding data or source dependencies (mostly for conftest.py-s)
    where needed.

Bump pytest version from 5.4.3 to 7.0.1

    We want at least pytest 6.2.5 for Python 3.10 support, but not past
    7.1.0 since it drops Python 3.6 support (which Ray still supports), thus
    the version constraint is set to <7.1.

    Updating pytest, combined with earlier BUILD fixes, changed the ground
    truth of a few error message based unit test, these tests are updated to
    reflect the change.

    There are also two small drive-by changes for making test_traceback and
    test_cli pass under Python 3.10. These are discovered while debugging CI
    failures (on earlier Python) with a Python 3.10 install locally.  Expect
    more such issues when adding Python 3.10 to CI.
2022-07-12 21:14:35 -07:00
..
BUILD Build Raylet with Bazel (#3806) 2019-01-20 12:16:47 -08:00
BUILD.cython Make sure the right Python interpreter is used (#4334) 2019-03-12 12:21:55 -07:00
BUILD.hiredis Windows cleanup (#9508) 2020-07-17 02:08:15 -07:00
BUILD.msgpack Bazel fixes (#9519) 2020-07-19 12:53:08 -07:00
BUILD.nlohmann_json [Object spilling] Clean up spilled objects on disk when Raylet starts (#16669) 2021-07-05 12:01:25 +08:00
BUILD.rapidjson [CI] Add clang-tidy to lint (#18124) 2021-09-09 00:41:53 -07:00
BUILD.redis Add 'local' Tag to @com_github_antirez_redis//:bin (#19685) 2021-10-26 09:17:52 -07:00
BUILD.spdlog [EVENT] add log reporter (#10419) 2020-09-16 11:54:05 +08:00
python.bzl Bump pytest from 5.4.3 to 7.0.1 (#26334) 2022-07-12 21:14:35 -07:00
ray.bzl [WINDOWS] remove complicated dos batch script that sometimes fails (#20670) 2021-11-23 08:59:29 -08:00
ray_deps_build_all.bzl [Streaming]Farewell : remove all of streaming related from ray repo. (#21770) 2022-01-23 17:53:41 +08:00
ray_deps_setup.bzl [Core] update protobuf to 3.19.4 (#25648) 2022-06-18 16:06:56 -07:00