GeezerVison is showing github.com — chore: Add ray unit test suites to noxfile.py and add ray_testing extras · RCLDevelopers/python-aiplatform@6c3838e
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: noxfile.py +28-1Lines changed: 28 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 67 | 67 | # 'docfx' is excluded since it only needs to run in 'docs-presubmit' | 68 | 68 | nox.options.sessions = [ | 69 | 69 | "unit", | | 70 | + "unit_ray", | 70 | 71 | "system", | 71 | 72 | "cover", | 72 | 73 | "lint", | @@ -190,8 +191,34 @@ def unit(session): | 190 | 191 | default(session) | 191 | 192 |
| 192 | 193 |
| 193 | | -def install_systemtest_dependencies(session, *constraints): | | 194 | +@nox.session(python="3.10") | | 195 | +@nox.parametrize("ray", ["2.4.0", "2.9.3"]) | | 196 | +def unit_ray(session, ray): | | 197 | + # Install all test dependencies, then install this package in-place. | | 198 | + | | 199 | + constraints_path = str(CURRENT_DIRECTORY / "testing" / f"constraints-ray-{ray}.txt") | | 200 | + standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES | | 201 | + session.install(*standard_deps, "-c", constraints_path) | | 202 | + | | 203 | + # Install ray extras | | 204 | + session.install("-e", ".[ray_testing]", "-c", constraints_path) | | 205 | + | | 206 | + # Run py.test against the unit tests. | | 207 | + session.run( | | 208 | + "py.test", | | 209 | + "--quiet", | | 210 | + f"--junitxml=unit_ray_{ray}_sponge_log.xml", | | 211 | + "--cov=google", | | 212 | + "--cov-append", | | 213 | + "--cov-config=.coveragerc", | | 214 | + "--cov-report=", | | 215 | + "--cov-fail-under=0", | | 216 | + os.path.join("tests", "unit", "vertex_ray"), | | 217 | + *session.posargs, | | 218 | + ) | 194 | 219 |
| | 220 | + | | 221 | +def install_systemtest_dependencies(session, *constraints): | 195 | 222 | # Use pre-release gRPC for system tests. | 196 | 223 | # Exclude version 1.52.0rc1 which has a known issue. | 197 | 224 | # See https://github.com/grpc/grpc/issues/32163 | |
Collapse file Copy file name to clipboardExpand all lines: setup.py +12Lines changed: 12 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 116 | 116 | "docstring_parser < 1", | 117 | 117 | ) | 118 | 118 |
| | 119 | +ray_testing_extra_require = ray_extra_require + [ | | 120 | + # ray train extras required for prediction tests | | 121 | + "ray[train] >= 2.4, <= 2.9.3,!= 2.5.*,!= 2.6.*,!= 2.7.*,!= 2.8.*,!=2.9.0,!=2.9.1,!=2.9.2", | | 122 | + # Framework version constraints copied from testing_extra_require | | 123 | + "scikit-learn", | | 124 | + "tensorflow", | | 125 | + "torch >= 2.0.0, < 2.1.0", | | 126 | + "xgboost", | | 127 | + "xgboost_ray", | | 128 | +] | | 129 | + | 119 | 130 | full_extra_require = list( | 120 | 131 | set( | 121 | 132 | tensorboard_extra_require | | 210 | 221 | "autologging": autologging_extra_require, | 211 | 222 | "preview": preview_extra_require, | 212 | 223 | "ray": ray_extra_require, | | 224 | + "ray_testing": ray_testing_extra_require, | 213 | 225 | }, | 214 | 226 | python_requires=">=3.8", | 215 | 227 | classifiers=[ | |
Collapse file Copy file name to clipboard +13Lines changed: 13 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +ray==2.4.0 | | 2 | +# Below constraints are inherited from constraints-3.10.txt | | 3 | +google-api-core | | 4 | +proto-plus==1.22.0 | | 5 | +protobuf | | 6 | +mock==4.0.2 | | 7 | +google-cloud-storage==2.2.1 # Increased for kfp 2.0 compatibility | | 8 | +packaging==20.0 # Increased for compatibility with MLFlow | | 9 | +grpcio-testing==1.34.0 | | 10 | +mlflow==1.30.1 # Pinned to speed up installation | | 11 | +pytest-xdist==3.3.1 # Pinned to unbreak unit tests | | 12 | +IPython # Added to test supernova rich html buttons | | 13 | + |
Collapse file Copy file name to clipboard +13Lines changed: 13 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +ray==2.9.3 | | 2 | +# Below constraints are inherited from constraints-3.10.txt | | 3 | +google-api-core | | 4 | +proto-plus==1.22.0 | | 5 | +protobuf | | 6 | +mock==4.0.2 | | 7 | +google-cloud-storage==2.2.1 # Increased for kfp 2.0 compatibility | | 8 | +packaging==20.0 # Increased for compatibility with MLFlow | | 9 | +grpcio-testing==1.34.0 | | 10 | +mlflow==1.30.1 # Pinned to speed up installation | | 11 | +pytest-xdist==3.3.1 # Pinned to unbreak unit tests | | 12 | +IPython # Added to test supernova rich html buttons | | 13 | + |
|