File tree 4 files changed +24
-4
lines changed
4 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ def login(self) -> str:
70
70
args .append ("--insecure-skip-tls-verify" )
71
71
try :
72
72
response = oc .invoke ("login" , args )
73
- except OpenShiftPythonException as osp :
73
+ except OpenShiftPythonException as osp : # pragma: no cover
74
74
error_msg = osp .result .err ()
75
75
if "The server uses a certificate signed by unknown authority" in error_msg :
76
76
return "Error: certificate auth failure, please set `skip_tls=True` in TokenAuthentication"
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ def status(
190
190
if status == CodeFlareClusterStatus .UNKNOWN :
191
191
pretty_print .print_no_resources_found ()
192
192
else :
193
- pretty_print .print_app_wrappers_status ([appwrapper ])
193
+ pretty_print .print_app_wrappers_status ([appwrapper ], starting = True )
194
194
195
195
return status , ready
196
196
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def print_no_resources_found():
32
32
console .print (Panel ("[red]No resources found, have you run cluster.up() yet?" ))
33
33
34
34
35
- def print_app_wrappers_status (app_wrappers : List [AppWrapper ]):
35
+ def print_app_wrappers_status (app_wrappers : List [AppWrapper ], starting : bool = False ):
36
36
if not app_wrappers :
37
37
print_no_resources_found ()
38
38
return # shortcircuit
@@ -48,6 +48,8 @@ def print_app_wrappers_status(app_wrappers: List[AppWrapper]):
48
48
for app_wrapper in app_wrappers :
49
49
name = app_wrapper .name
50
50
status = app_wrapper .status .value
51
+ if starting :
52
+ status += " (starting)"
51
53
table .add_row (name , status )
52
54
table .add_row ("" ) # empty row for spacing
53
55
@@ -57,7 +59,7 @@ def print_app_wrappers_status(app_wrappers: List[AppWrapper]):
57
59
def print_cluster_status (cluster : RayCluster ):
58
60
"Pretty prints the status of a passed-in cluster"
59
61
if not cluster :
60
- print_no_resources_found
62
+ print_no_resources_found ()
61
63
return
62
64
63
65
console = Console ()
Original file line number Diff line number Diff line change @@ -320,6 +320,19 @@ def test_print_no_resources(capsys):
320
320
)
321
321
322
322
323
+ def test_print_no_cluster (capsys ):
324
+ try :
325
+ print_cluster_status (None )
326
+ except :
327
+ assert 1 == 0
328
+ captured = capsys .readouterr ()
329
+ assert captured .out == (
330
+ "╭──────────────────────────────────────────────────────────────────────────────╮\n "
331
+ "│ No resources found, have you run cluster.up() yet? │\n "
332
+ "╰──────────────────────────────────────────────────────────────────────────────╯\n "
333
+ )
334
+
335
+
323
336
def test_print_appwrappers (capsys ):
324
337
aw1 = AppWrapper (
325
338
name = "awtest1" ,
@@ -1576,3 +1589,8 @@ def test_cmd_line_generation():
1576
1589
)
1577
1590
os .remove ("unit-test-cluster.yaml" )
1578
1591
os .remove ("unit-cmd-cluster.yaml" )
1592
+
1593
+
1594
+ def test_cleanup ():
1595
+ os .remove ("test.yaml" )
1596
+ os .remove ("raytest2.yaml" )
You can’t perform that action at this time.
0 commit comments