File tree 2 files changed +40
-0
lines changed
src/codeflare_sdk/ray/cluster
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ [run]
2
+ omit =
3
+ src/**/test_*.py,,src/codeflare_sdk/common/utils/unit_test_support.py
4
+
5
+ [report]
6
+ exclude_lines =
7
+ pragma: no cover
8
+
Original file line number Diff line number Diff line change @@ -224,6 +224,38 @@ def test_cluster_uris(mocker):
224
224
)
225
225
226
226
227
+ def test_openshift_cluster_dashboard_uri (mocker ):
228
+ # Mocking necessary dependencies
229
+ mocker .patch ("kubernetes.config.load_kube_config" , return_value = "ignore" )
230
+ mocker .patch (
231
+ "codeflare_sdk.ray.cluster.cluster._is_openshift_cluster" , return_value = True
232
+ )
233
+ mocker .patch (
234
+ "kubernetes.client.CustomObjectsApi.list_namespaced_custom_object" ,
235
+ return_value = {
236
+ "items" : [
237
+ {
238
+ "metadata" : {
239
+ "name" : "ray-dashboard-unit-test-cluster" ,
240
+ "annotations" : {"route.openshift.io/termination" : "tls" },
241
+ },
242
+ "spec" : {
243
+ "host" : "ray-dashboard-unit-test-cluster-ns.apps.cluster.awsroute.org" ,
244
+ "tls" : {"termination" : "passthrough" },
245
+ },
246
+ }
247
+ ]
248
+ },
249
+ )
250
+ # Creating the cluster instance
251
+ cluster = create_cluster (mocker )
252
+ # Validating the output
253
+ assert (
254
+ cluster .cluster_dashboard_uri ()
255
+ == "https://ray-dashboard-unit-test-cluster-ns.apps.cluster.awsroute.org"
256
+ )
257
+
258
+
227
259
def test_ray_job_wrapping (mocker ):
228
260
import ray
229
261
You can’t perform that action at this time.
0 commit comments