File tree Expand file tree Collapse file tree 4 files changed +24
-4
lines changed Expand file tree Collapse file tree 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:
7070 args .append ("--insecure-skip-tls-verify" )
7171 try :
7272 response = oc .invoke ("login" , args )
73- except OpenShiftPythonException as osp :
73+ except OpenShiftPythonException as osp : # pragma: no cover
7474 error_msg = osp .result .err ()
7575 if "The server uses a certificate signed by unknown authority" in error_msg :
7676 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(
190190 if status == CodeFlareClusterStatus .UNKNOWN :
191191 pretty_print .print_no_resources_found ()
192192 else :
193- pretty_print .print_app_wrappers_status ([appwrapper ])
193+ pretty_print .print_app_wrappers_status ([appwrapper ], starting = True )
194194
195195 return status , ready
196196
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def print_no_resources_found():
3232 console .print (Panel ("[red]No resources found, have you run cluster.up() yet?" ))
3333
3434
35- def print_app_wrappers_status (app_wrappers : List [AppWrapper ]):
35+ def print_app_wrappers_status (app_wrappers : List [AppWrapper ], starting : bool = False ):
3636 if not app_wrappers :
3737 print_no_resources_found ()
3838 return # shortcircuit
@@ -48,6 +48,8 @@ def print_app_wrappers_status(app_wrappers: List[AppWrapper]):
4848 for app_wrapper in app_wrappers :
4949 name = app_wrapper .name
5050 status = app_wrapper .status .value
51+ if starting :
52+ status += " (starting)"
5153 table .add_row (name , status )
5254 table .add_row ("" ) # empty row for spacing
5355
@@ -57,7 +59,7 @@ def print_app_wrappers_status(app_wrappers: List[AppWrapper]):
5759def print_cluster_status (cluster : RayCluster ):
5860 "Pretty prints the status of a passed-in cluster"
5961 if not cluster :
60- print_no_resources_found
62+ print_no_resources_found ()
6163 return
6264
6365 console = Console ()
Original file line number Diff line number Diff line change @@ -320,6 +320,19 @@ def test_print_no_resources(capsys):
320320 )
321321
322322
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+
323336def test_print_appwrappers (capsys ):
324337 aw1 = AppWrapper (
325338 name = "awtest1" ,
@@ -1576,3 +1589,8 @@ def test_cmd_line_generation():
15761589 )
15771590 os .remove ("unit-test-cluster.yaml" )
15781591 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