|
73 | 73 | get_package_and_version,
|
74 | 74 | )
|
75 | 75 |
|
| 76 | +from codeflare_sdk.common.kueue import * |
| 77 | + |
76 | 78 | import codeflare_sdk.common.kubernetes_cluster.kube_api_helpers
|
77 | 79 | from codeflare_sdk.ray.cluster.generate_yaml import (
|
78 | 80 | gen_names,
|
@@ -968,7 +970,7 @@ def test_ray_details(mocker, capsys):
|
968 | 970 | return_value="",
|
969 | 971 | )
|
970 | 972 | mocker.patch(
|
971 |
| - "codeflare_sdk.ray.cluster.generate_yaml.local_queue_exists", |
| 973 | + "codeflare_sdk.common.kueue.kueue.local_queue_exists", |
972 | 974 | return_value="true",
|
973 | 975 | )
|
974 | 976 | cf = Cluster(
|
@@ -2007,7 +2009,7 @@ def test_get_cluster_openshift(mocker):
|
2007 | 2009 | ]
|
2008 | 2010 | mocker.patch("kubernetes.client.ApisApi", return_value=mock_api)
|
2009 | 2011 | mocker.patch(
|
2010 |
| - "codeflare_sdk.ray.cluster.generate_yaml.local_queue_exists", |
| 2012 | + "codeflare_sdk.common.kueue.kueue.local_queue_exists", |
2011 | 2013 | return_value="true",
|
2012 | 2014 | )
|
2013 | 2015 |
|
@@ -2042,7 +2044,7 @@ def custom_side_effect(group, version, namespace, plural, **kwargs):
|
2042 | 2044 | ],
|
2043 | 2045 | )
|
2044 | 2046 | mocker.patch(
|
2045 |
| - "codeflare_sdk.ray.cluster.generate_yaml.local_queue_exists", |
| 2047 | + "codeflare_sdk.common.kueue.kueue.local_queue_exists", |
2046 | 2048 | return_value="true",
|
2047 | 2049 | )
|
2048 | 2050 |
|
@@ -2085,7 +2087,7 @@ def test_get_cluster(mocker):
|
2085 | 2087 | return_value=ingress_retrieval(cluster_name="quicktest", client_ing=True),
|
2086 | 2088 | )
|
2087 | 2089 | mocker.patch(
|
2088 |
| - "codeflare_sdk.ray.cluster.generate_yaml.local_queue_exists", |
| 2090 | + "codeflare_sdk.common.kueue.kueue.local_queue_exists", |
2089 | 2091 | return_value="true",
|
2090 | 2092 | )
|
2091 | 2093 | cluster = get_cluster("quicktest")
|
@@ -2123,7 +2125,7 @@ def test_get_cluster_no_mcad(mocker):
|
2123 | 2125 | return_value=ingress_retrieval(cluster_name="quicktest", client_ing=True),
|
2124 | 2126 | )
|
2125 | 2127 | mocker.patch(
|
2126 |
| - "codeflare_sdk.ray.cluster.generate_yaml.local_queue_exists", |
| 2128 | + "codeflare_sdk.common.kueue.kueue.local_queue_exists", |
2127 | 2129 | return_value="true",
|
2128 | 2130 | )
|
2129 | 2131 | cluster = get_cluster("quicktest")
|
@@ -2359,7 +2361,7 @@ def test_cluster_status(mocker):
|
2359 | 2361 | mocker.patch("kubernetes.client.ApisApi.get_api_versions")
|
2360 | 2362 | mocker.patch("kubernetes.config.load_kube_config", return_value="ignore")
|
2361 | 2363 | mocker.patch(
|
2362 |
| - "codeflare_sdk.ray.cluster.generate_yaml.local_queue_exists", |
| 2364 | + "codeflare_sdk.common.kueue.kueue.local_queue_exists", |
2363 | 2365 | return_value="true",
|
2364 | 2366 | )
|
2365 | 2367 | fake_aw = AppWrapper("test", AppWrapperStatus.FAILED)
|
@@ -2462,7 +2464,7 @@ def test_wait_ready(mocker, capsys):
|
2462 | 2464 | "codeflare_sdk.ray.cluster.cluster._ray_cluster_status", return_value=None
|
2463 | 2465 | )
|
2464 | 2466 | mocker.patch(
|
2465 |
| - "codeflare_sdk.ray.cluster.generate_yaml.local_queue_exists", |
| 2467 | + "codeflare_sdk.common.kueue.kueue.local_queue_exists", |
2466 | 2468 | return_value="true",
|
2467 | 2469 | )
|
2468 | 2470 | mocker.patch.object(
|
@@ -2694,11 +2696,11 @@ def test_cluster_throw_for_no_raycluster(mocker: MockerFixture):
|
2694 | 2696 | return_value="opendatahub",
|
2695 | 2697 | )
|
2696 | 2698 | mocker.patch(
|
2697 |
| - "codeflare_sdk.ray.cluster.generate_yaml.get_default_kueue_name", |
| 2699 | + "codeflare_sdk.common.kueue.kueue.get_default_kueue_name", |
2698 | 2700 | return_value="default",
|
2699 | 2701 | )
|
2700 | 2702 | mocker.patch(
|
2701 |
| - "codeflare_sdk.ray.cluster.generate_yaml.local_queue_exists", |
| 2703 | + "codeflare_sdk.common.kueue.kueue.local_queue_exists", |
2702 | 2704 | return_value="true",
|
2703 | 2705 | )
|
2704 | 2706 |
|
@@ -2923,13 +2925,9 @@ def test_cluster_up_down_buttons(mocker):
|
2923 | 2925 | "ipywidgets.Checkbox"
|
2924 | 2926 | ) as MockCheckbox, patch("ipywidgets.Output"), patch("ipywidgets.HBox"), patch(
|
2925 | 2927 | "ipywidgets.VBox"
|
2926 |
| - ), patch.object( |
2927 |
| - cluster, "up" |
2928 |
| - ) as mock_up, patch.object( |
| 2928 | + ), patch.object(cluster, "up") as mock_up, patch.object( |
2929 | 2929 | cluster, "down"
|
2930 |
| - ) as mock_down, patch.object( |
2931 |
| - cluster, "wait_ready" |
2932 |
| - ) as mock_wait_ready: |
| 2930 | + ) as mock_down, patch.object(cluster, "wait_ready") as mock_wait_ready: |
2933 | 2931 | # Create mock button & CheckBox instances
|
2934 | 2932 | mock_up_button = MagicMock()
|
2935 | 2933 | mock_down_button = MagicMock()
|
@@ -3041,13 +3039,9 @@ def test_view_clusters(mocker, capsys):
|
3041 | 3039 | "ipywidgets.Button"
|
3042 | 3040 | ) as MockButton, patch("ipywidgets.Output") as MockOutput, patch(
|
3043 | 3041 | "ipywidgets.HBox"
|
3044 |
| - ), patch( |
3045 |
| - "ipywidgets.VBox" |
3046 |
| - ), patch( |
| 3042 | + ), patch("ipywidgets.VBox"), patch( |
3047 | 3043 | "IPython.display.display"
|
3048 |
| - ) as mock_display, patch( |
3049 |
| - "IPython.display.HTML" |
3050 |
| - ), patch( |
| 3044 | + ) as mock_display, patch("IPython.display.HTML"), patch( |
3051 | 3045 | "codeflare_sdk.cluster.widgets.Javascript"
|
3052 | 3046 | ) as mock_javascript:
|
3053 | 3047 | # Create mock widget instances
|
|
0 commit comments