Skip to content

Commit 3f25c39

Browse files
committed
make sure tests run without oc login
1 parent 0d676ed commit 3f25c39

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Diff for: src/codeflare_sdk/utils/generate_yaml.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import argparse
2323
import uuid
2424
from kubernetes import client, config
25-
from .kube_api_helpers import _kube_api_error_handling
25+
from codeflare_sdk.utils.kube_api_helpers import _kube_api_error_handling
2626

2727

2828
def read_template(template):
@@ -247,7 +247,7 @@ def enable_local_interactive(resources, cluster_name, namespace):
247247
"config.openshift.io", "v1", "ingresses", "cluster"
248248
)
249249
except Exception as e: # pragma: no cover
250-
return _kube_api_error_handling(e)
250+
return _kube_api_error_handling(e)
251251
domain = ingress["spec"]["domain"]
252252
command = command.replace("server-name", domain)
253253

Diff for: tests/unit_test.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,18 @@ def test_local_client_url(mocker):
388388
"codeflare_sdk.cluster.cluster._get_ingress_domain",
389389
return_value="apps.cluster.awsroute.org",
390390
)
391-
default_config = ClusterConfiguration(
392-
name="unit-test-cluster", namespace="ns", local_interactive=True
391+
mocker.patch(
392+
"codeflare_sdk.cluster.cluster.Cluster.create_app_wrapper",
393+
return_value="unit-test-cluster-localinter.yaml",
393394
)
394-
cluster = Cluster(default_config)
395+
396+
cluster_config = ClusterConfiguration(
397+
name="unit-test-cluster-localinter", namespace="ns", local_interactive=True
398+
)
399+
cluster = Cluster(cluster_config)
395400
assert (
396401
cluster.local_client_url()
397-
== "ray://rayclient-unit-test-cluster-ns.apps.cluster.awsroute.org"
402+
== "ray://rayclient-unit-test-cluster-localinter-ns.apps.cluster.awsroute.org"
398403
)
399404

400405

0 commit comments

Comments
 (0)