|
30 | 30 | get_ray_obj_with_status,
|
31 | 31 | get_aw_obj_with_status,
|
32 | 32 | patch_cluster_with_dynamic_client,
|
| 33 | + route_list_retrieval, |
33 | 34 | )
|
34 | 35 | from codeflare_sdk.ray.cluster.cluster import _is_openshift_cluster
|
35 | 36 | from pathlib import Path
|
@@ -223,6 +224,52 @@ def test_cluster_uris(mocker):
|
223 | 224 | == "Dashboard not available yet, have you run cluster.up()?"
|
224 | 225 | )
|
225 | 226 |
|
| 227 | + mocker.patch( |
| 228 | + "codeflare_sdk.ray.cluster.cluster._is_openshift_cluster", return_value=True |
| 229 | + ) |
| 230 | + mocker.patch( |
| 231 | + "kubernetes.client.CustomObjectsApi.list_namespaced_custom_object", |
| 232 | + return_value={ |
| 233 | + "items": [ |
| 234 | + { |
| 235 | + "metadata": { |
| 236 | + "name": "ray-dashboard-unit-test-cluster", |
| 237 | + }, |
| 238 | + "spec": { |
| 239 | + "host": "ray-dashboard-unit-test-cluster-ns.apps.cluster.awsroute.org", |
| 240 | + "tls": {}, # Indicating HTTPS |
| 241 | + }, |
| 242 | + } |
| 243 | + ] |
| 244 | + }, |
| 245 | + ) |
| 246 | + cluster = create_cluster(mocker) |
| 247 | + assert ( |
| 248 | + cluster.cluster_dashboard_uri() |
| 249 | + == "http://ray-dashboard-unit-test-cluster-ns.apps.cluster.awsroute.org" |
| 250 | + ) |
| 251 | + mocker.patch( |
| 252 | + "kubernetes.client.CustomObjectsApi.list_namespaced_custom_object", |
| 253 | + return_value={ |
| 254 | + "items": [ |
| 255 | + { |
| 256 | + "metadata": { |
| 257 | + "name": "ray-dashboard-unit-test-cluster", |
| 258 | + }, |
| 259 | + "spec": { |
| 260 | + "host": "ray-dashboard-unit-test-cluster-ns.apps.cluster.awsroute.org", |
| 261 | + "tls": {"termination": "passthrough"}, # Indicating HTTPS |
| 262 | + }, |
| 263 | + } |
| 264 | + ] |
| 265 | + }, |
| 266 | + ) |
| 267 | + cluster = create_cluster(mocker) |
| 268 | + assert ( |
| 269 | + cluster.cluster_dashboard_uri() |
| 270 | + == "https://ray-dashboard-unit-test-cluster-ns.apps.cluster.awsroute.org" |
| 271 | + ) |
| 272 | + |
226 | 273 |
|
227 | 274 | def test_ray_job_wrapping(mocker):
|
228 | 275 | import ray
|
|
0 commit comments