File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 67
67
from tests .unit_test_support import (
68
68
createClusterWithConfig ,
69
69
createClusterConfig ,
70
+ createClusterWrongType ,
70
71
)
71
72
72
73
import codeflare_sdk .utils .kube_api_helpers
@@ -267,6 +268,10 @@ def test_config_creation():
267
268
assert config .image_pull_secrets == ["unit-test-pull-secret" ]
268
269
assert config .appwrapper == True
269
270
271
+ def test_config_creation_wrong_type ():
272
+ with pytest .raises (TypeError ):
273
+ config = createClusterWrongType ()
274
+
270
275
271
276
def test_cluster_creation (mocker ):
272
277
# Create AppWrapper containing a Ray Cluster with no local queue specified
Original file line number Diff line number Diff line change @@ -31,3 +31,21 @@ def createClusterWithConfig(mocker):
31
31
)
32
32
cluster = Cluster (createClusterConfig ())
33
33
return cluster
34
+
35
+ def createClusterWrongType ():
36
+ config = ClusterConfiguration (
37
+ name = "unit-test-cluster" ,
38
+ namespace = "ns" ,
39
+ num_workers = 2 ,
40
+ worker_cpu_requests = [],
41
+ worker_cpu_limits = 4 ,
42
+ worker_memory_requests = 5 ,
43
+ worker_memory_limits = 6 ,
44
+ worker_extended_resource_requests = {"nvidia.com/gpu" : 7 },
45
+ appwrapper = True ,
46
+ machine_types = ["cpu.small" , "gpu.large" ],
47
+ image_pull_secrets = ["unit-test-pull-secret" ],
48
+ image = "quay.io/rhoai/ray:2.23.0-py39-cu121" ,
49
+ write_to_file = True ,
50
+ )
51
+ return config
You can’t perform that action at this time.
0 commit comments