Skip to content

Commit d6493f5

Browse files
committed
fix more incorrect test cases that were assuming that appwrappers don't get a localqueue
1 parent 9d03bb7 commit d6493f5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/unit_test.py

+24
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,10 @@ def test_ray_details(mocker, capsys):
888888
"codeflare_sdk.cluster.cluster.Cluster.cluster_dashboard_uri",
889889
return_value="",
890890
)
891+
mocker.patch(
892+
"codeflare_sdk.utils.generate_yaml.local_queue_exists",
893+
return_value="true",
894+
)
891895
cf = Cluster(
892896
ClusterConfiguration(
893897
name="raytest2",
@@ -1933,6 +1937,10 @@ def test_get_cluster_openshift(mocker):
19331937
MagicMock(versions=[MagicMock(group_version="route.openshift.io/v1")])
19341938
]
19351939
mocker.patch("kubernetes.client.ApisApi", return_value=mock_api)
1940+
mocker.patch(
1941+
"codeflare_sdk.utils.generate_yaml.local_queue_exists",
1942+
return_value="true",
1943+
)
19361944

19371945
assert is_openshift_cluster()
19381946

@@ -1997,6 +2005,10 @@ def test_get_cluster(mocker):
19972005
"kubernetes.client.NetworkingV1Api.list_namespaced_ingress",
19982006
return_value=ingress_retrieval(cluster_name="quicktest", client_ing=True),
19992007
)
2008+
mocker.patch(
2009+
"codeflare_sdk.utils.generate_yaml.local_queue_exists",
2010+
return_value="true",
2011+
)
20002012
cluster = get_cluster("quicktest")
20012013
cluster_config = cluster.config
20022014
assert cluster_config.name == "quicktest" and cluster_config.namespace == "ns"
@@ -2025,6 +2037,10 @@ def test_get_cluster_no_mcad(mocker):
20252037
"kubernetes.client.NetworkingV1Api.list_namespaced_ingress",
20262038
return_value=ingress_retrieval(cluster_name="quicktest", client_ing=True),
20272039
)
2040+
mocker.patch(
2041+
"codeflare_sdk.utils.generate_yaml.local_queue_exists",
2042+
return_value="true",
2043+
)
20282044
cluster = get_cluster("quicktest")
20292045
cluster_config = cluster.config
20302046
assert cluster_config.name == "quicktest" and cluster_config.namespace == "ns"
@@ -2250,6 +2266,10 @@ def test_list_queue_rayclusters(mocker, capsys):
22502266
def test_cluster_status(mocker):
22512267
mocker.patch("kubernetes.client.ApisApi.get_api_versions")
22522268
mocker.patch("kubernetes.config.load_kube_config", return_value="ignore")
2269+
mocker.patch(
2270+
"codeflare_sdk.utils.generate_yaml.local_queue_exists",
2271+
return_value="true",
2272+
)
22532273
fake_aw = AppWrapper("test", AppWrapperStatus.FAILED)
22542274
fake_ray = RayCluster(
22552275
name="test",
@@ -2341,6 +2361,10 @@ def test_wait_ready(mocker, capsys):
23412361
mocker.patch("kubernetes.config.load_kube_config", return_value="ignore")
23422362
mocker.patch("codeflare_sdk.cluster.cluster._app_wrapper_status", return_value=None)
23432363
mocker.patch("codeflare_sdk.cluster.cluster._ray_cluster_status", return_value=None)
2364+
mocker.patch(
2365+
"codeflare_sdk.utils.generate_yaml.local_queue_exists",
2366+
return_value="true",
2367+
)
23442368
mocker.patch.object(
23452369
client.CustomObjectsApi,
23462370
"list_namespaced_custom_object",

0 commit comments

Comments
 (0)