123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342 |
- load("//bazel:python.bzl", "py_test_run_all_subdirectory")
- load("//bazel:python.bzl", "py_test_run_all_notebooks")
- load("//bazel:python.bzl", "doctest")
- exports_files(["test_myst_doc.py"])
- # --------------------------------------------------------------------
- # Tests from the doc directory.
- # Please keep these sorted alphabetically, but start with the
- # root directory.
- # --------------------------------------------------------------------
- py_test(
- name = "highly_parallel",
- size = "medium",
- main = "test_myst_doc.py",
- srcs = ["test_myst_doc.py"],
- tags = ["exclusive", "team:ml", "highly_parallel"],
- data = ["//doc/source/ray-core/examples:core_examples"],
- args = ["--path", "doc/source/ray-core/examples/highly_parallel.ipynb"]
- )
- ### Ray Data
- py_test(
- name = "datasets_train",
- size = "medium",
- srcs = ["source/ray-core/_examples/datasets_train/datasets_train.py"],
- tags = ["exclusive", "team:ml", "datasets_train"],
- args = ["--smoke-test", "--num-workers=2", "--use-gpu"]
- )
- py_test(
- name = "plot_hyperparameter",
- size = "small",
- main = "test_myst_doc.py",
- srcs = ["test_myst_doc.py"],
- args = ["--path", "doc/source/ray-core/examples/plot_hyperparameter.ipynb"],
- data = ["//doc/source/ray-core/examples:core_examples"],
- tags = ["exclusive", "team:ml"]
- )
- py_test(
- name = "automl_for_time_series",
- size = "medium",
- main = "test_myst_doc.py",
- srcs = ["test_myst_doc.py"],
- tags = ["exclusive", "team:ml", "timeseries_libs"],
- data = ["//doc/source/ray-core/examples:core_examples"],
- args = ["--path", "doc/source/ray-core/examples/automl_for_time_series.ipynb"]
- )
- py_test(
- name = "batch_prediction",
- size = "medium",
- main = "test_myst_doc.py",
- srcs = ["test_myst_doc.py"],
- tags = ["exclusive", "team:ml"],
- data = ["//doc/source/ray-core/examples:core_examples"],
- args = ["--path", "doc/source/ray-core/examples/batch_prediction.ipynb"]
- )
- py_test(
- name = "batch_training",
- size = "medium",
- main = "test_myst_doc.py",
- srcs = ["test_myst_doc.py"],
- tags = ["exclusive", "team:ml"],
- data = ["//doc/source/ray-core/examples:core_examples"],
- args = ["--path", "doc/source/ray-core/examples/batch_training.ipynb"]
- )
- py_test(
- name = "plot_parameter_server",
- size = "medium",
- main = "test_myst_doc.py",
- srcs = ["test_myst_doc.py"],
- args = ["--path", "doc/source/ray-core/examples/plot_parameter_server.ipynb"],
- data = ["//doc/source/ray-core/examples:core_examples"],
- tags = ["exclusive", "team:ml"]
- )
- py_test(
- name = "plot_pong_example",
- size = "large",
- main = "test_myst_doc.py",
- srcs = ["test_myst_doc.py"],
- args = ["--path", "doc/source/ray-core/examples/plot_pong_example.ipynb"],
- data = ["//doc/source/ray-core/examples:core_examples"],
- tags = ["exclusive", "team:ml"]
- )
- # --------------------------------------------------------------------
- # Test all doc/source/ray-observability/doc_code code included in rst/md files.
- # --------------------------------------------------------------------
- py_test_run_all_subdirectory(
- size = "medium",
- include = ["source/ray-observability/doc_code/*.py"],
- exclude = [],
- extra_srcs = [],
- tags = ["exclusive", "team:core"],
- )
- # --------------------------------------------------------------------
- # Test all doc/source/ray-core/doc_code code included in rst/md files.
- # --------------------------------------------------------------------
- py_test(
- name = "doc_code_runtime_env_example",
- size = "small",
- main = "source/ray-core/doc_code/runtime_env_example.py",
- srcs = ["source/ray-core/doc_code/runtime_env_example.py"],
- tags = ["exclusive", "post_wheel_build", "team:serve"]
- )
- py_test_run_all_subdirectory(
- size = "medium",
- include = ["source/ray-core/doc_code/*.py"],
- exclude = ["source/ray-core/doc_code/runtime_env_example.py",
- "source/ray-core/doc_code/cross_language.py"],
- extra_srcs = [],
- tags = ["exclusive", "team:core"],
- )
- # --------------------------------------------------------------------
- # Test all doc/source/serve/doc_code code included in rst/md files.
- # --------------------------------------------------------------------
- py_test_run_all_subdirectory(
- size = "medium",
- include = ["source/serve/doc_code/**/*.py"],
- exclude = [
- "source/serve/doc_code/distilbert.py",
- "source/serve/doc_code/stable_diffusion.py",
- "source/serve/doc_code/object_detection.py",
- "source/serve/doc_code/streaming_example.py",
- ],
- extra_srcs = [],
- tags = ["exclusive", "team:serve"],
- )
- py_test_run_all_subdirectory(
- size = "medium",
- include = ["source/serve/doc_code/streaming_example.py"],
- exclude = [],
- extra_srcs = [],
- tags = ["exclusive", "team:serve"],
- env = {"RAY_SERVE_ENABLE_EXPERIMENTAL_STREAMING": "1"},
- )
- py_test_run_all_subdirectory(
- size = "medium",
- include = [
- "source/serve/doc_code/distilbert.py",
- "source/serve/doc_code/stable_diffusion.py",
- "source/serve/doc_code/object_detection.py",
- ],
- exclude = [],
- extra_srcs = [],
- tags = ["exclusive", "team:serve", "gpu"],
- env = {"RAY_SERVE_PROXY_READY_CHECK_TIMEOUT_S": "60"},
- )
- # --------------------------------------------------------------------
- # Test all doc/source/tune/doc_code code included in rst/md files.
- # --------------------------------------------------------------------
- py_test_run_all_subdirectory(
- size = "medium",
- include = ["source/tune/doc_code/*.py"],
- exclude = [],
- extra_srcs = [],
- tags = ["exclusive", "team:ml"],
- )
- # --------------------------------------------------------------------
- # Test all doc/source/rllib/doc_code code included in rst/md files.
- # --------------------------------------------------------------------
- py_test_run_all_subdirectory(
- size = "medium",
- include = ["source/rllib/doc_code/*.py"],
- exclude = [],
- extra_srcs = [],
- tags = ["exclusive", "team:rllib"],
- )
- # --------------------------------------------------------------------
- # Test all doc/source/ray-air/doc_code code included in rst/md files.
- # --------------------------------------------------------------------
- py_test_run_all_subdirectory(
- size = "large",
- include = ["source/ray-air/doc_code/*.py"],
- exclude = [
- # Too large. Use a custom test below.
- "source/ray-air/doc_code/computer_vision.py",
- "source/ray-air/doc_code/hf_trainer.py", # Too large
- "source/ray-air/doc_code/predictors.py",
- ],
- extra_srcs = [],
- tags = ["exclusive", "team:ml"],
- )
- py_test(
- size = "enormous",
- name = "computer_vision_test",
- main = "source/ray-air/doc_code/computer_vision.py",
- srcs = ["source/ray-air/doc_code/computer_vision.py"],
- tags = ["exclusive", "team:ml"],
- )
- # --------------------------------------------------------------------
- # Test all doc/source/train/doc_code code included in rst/md files.
- # --------------------------------------------------------------------
- py_test_run_all_subdirectory(
- size = "large",
- include = ["source/train/doc_code/*.py"],
- exclude = [],
- extra_srcs = [],
- tags = ["exclusive", "team:ml"],
- )
- # --------------------------------------------------------------------
- # Test all doc/source/ray-overview/doc_test snippets, used on ray.io
- # --------------------------------------------------------------------
- py_test_run_all_subdirectory(
- size = "small",
- include = ["source/ray-overview/doc_test/*.py"],
- exclude = ["source/ray-overview/doc_test/ray_data.py"],
- extra_srcs = [],
- tags = ["exclusive", "team:ml"],
- )
- # --------------------------------------------------------------------
- # Test all doc/source/data/doc_code code included in rst/md files.
- # --------------------------------------------------------------------
- py_test_run_all_subdirectory(
- size = "large",
- include = ["source/data/doc_code/*.py"],
- exclude = [
- "source/ray-air/doc_code/predictors.py",
- "source/data/doc_code/loading_data_untested.py",
- ],
- extra_srcs = [],
- tags = ["exclusive", "team:data"],
- )
- # --------------------------------------------------------------------
- # Workspace templates tests
- # --------------------------------------------------------------------
- # Validate that all the paths and yamls within the templates.yaml file are valid.
- py_test(
- name = "templates_directory_validation",
- size = "small",
- main = "source/templates/testing/validate.py",
- srcs = ["source/templates/testing/validate.py"],
- data = glob(["source/templates/**/*"]),
- tags = ["exclusive", "team:ml"]
- )
- # --------------
- # Run GPU tests
- # --------------
- py_test_run_all_subdirectory(
- size = "large",
- include = ["source/ray-air/doc_code/predictors.py"],
- exclude = [],
- extra_srcs = [],
- tags = ["exclusive", "team:ml", "ray_air", "gpu"],
- )
- py_test(
- name = "pytorch_resnet_finetune",
- size = "large",
- main = "test_myst_doc.py",
- srcs = ["test_myst_doc.py"],
- tags = ["exclusive", "team:ml", "gpu", "ray_air"],
- data = ["//doc/source/train/examples/pytorch:train_pytorch_examples"],
- args = ["--path", "doc/source/train/examples/pytorch/pytorch_resnet_finetune.ipynb"]
- )
- # --------------------------------------------------------------------
- # Test all doc/external code
- # --------------------------------------------------------------------
- py_test_run_all_subdirectory(
- size = "large",
- include = ["external/*.py"],
- exclude = [],
- extra_srcs = [],
- tags = ["exclusive", "team:ml", "external"],
- )
- # --------------------------------------------------------------------
- # Tests code snippets in user guides.
- # --------------------------------------------------------------------
- doctest(
- files = glob(
- include=["source/**/*.rst", "source/**/*.md"],
- exclude=[
- "source/ray-contribute/getting-involved.rst",
- "source/ray-core/handling-dependencies.rst",
- "source/ray-core/tasks/nested-tasks.rst",
- "source/ray-observability/user-guides/ray-tracing.rst",
- "source/ray-observability/user-guides/cli-sdk.rst",
- "source/rllib/rllib-env.rst",
- "source/rllib/rllib-sample-collection.rst",
- "source/serve/advanced-guides/inplace-updates.md",
- "source/serve/deploy-many-models/multi-app.md",
- "source/serve/production-guide/deploy-vm.md",
- "source/serve/production-guide/fault-tolerance.md",
- "source/data/batch_inference.rst",
- "source/data/transforming-data.rst",
- "source/train/faq.rst"
- ]
- ),
- size = "large",
- tags = ["team:none"]
- )
- doctest(
- files = [
- "source/data/batch_inference.rst",
- "source/data/transforming-data.rst"
- ],
- tags = ["team:data"],
- gpu = True
- )
|