Skip to content

Commit e928698

Browse files
Mock get_cluster_custom_object in existing httproute test
The GatewayConfig fallback code calls get_cluster_custom_object, which was previously unmocked in the "no hostname" test cases. On CI, the unmocked call could return stale data instead of raising, causing the test to get a URL when it expected None.
1 parent f1e50e0 commit e928698

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/codeflare_sdk/ray/cluster/test_cluster.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,10 @@ def mock_list_empty_routes(group, version, namespace, plural, label_selector=Non
12281228
"kubernetes.client.CustomObjectsApi.list_namespaced_custom_object",
12291229
side_effect=mock_list_empty_routes,
12301230
)
1231+
mocker.patch(
1232+
"kubernetes.client.CustomObjectsApi.get_cluster_custom_object",
1233+
side_effect=Exception("No GatewayConfig"),
1234+
)
12311235

12321236
result = _get_dashboard_url_from_httproute("test-cluster", "test-ns")
12331237
assert result is None, (

0 commit comments

Comments
 (0)