@@ -43,15 +43,6 @@ test_true(grepl("5555", local_url(tcp = TRUE, port = 5555), fixed = TRUE))
4343test_type(" list" , ssh_config(" ssh://remotehost" ))
4444test_type(" list" , ssh_config(" ssh://remotehost" , tunnel = TRUE ))
4545test_type(" list" , cluster_config())
46- test_error(cloud_config(platform = " " ), " not supported" )
47- if (is.null(mirai ::: posit_tools())) {
48- test_error(cloud_config(platform = " posit" ), " can only be used from Posit Workbench" )
49- ns <- new.env(parent = emptyenv())
50- `[[<-`(ns , " .rs.api.launcher.jobsFeatureAvailable" , function () TRUE )
51- `[[<-`(ns , " .rs.api.launcher.getInfo" , function () list (clusters = list (list (name = " Kubernetes" , defaultImage = " 1.a.b.reg.prov.com/int-r-sess:ubuntu2204-20250609" ))))
52- attach(ns , name = " tools:rstudio" )
53- }
54- test_type(" list" , cloud_config(platform = " posit" ))
5546test_true(is_mirai_interrupt(r <- mirai ::: mk_interrupt_error()))
5647test_print(r )
5748test_true(is_mirai_error(r <- `class<-`(" Error in: testing\n " , c(" miraiError" , " errorValue" , " try-error" ))))
@@ -69,6 +60,23 @@ for (i in 0:4)
6960test_null(register_serial(" test_klass1" , serialize , unserialize ))
7061test_null(register_serial(c(" test_klass2" , " test_klass3" ), list (serialize , serialize ), list (unserialize , unserialize )))
7162test_equal(length(mirai ::: . [[" serial" ]][[3L ]]), 3L )
63+ # cloud launcher tests
64+ test_error(cloud_config(platform = " " ), " not supported" )
65+ is.null(mirai ::: posit_tools()) && {
66+ ns <- new.env(parent = emptyenv())
67+ `[[<-`(ns , " .rs.api.launcher.jobsFeatureAvailable" , function () TRUE )
68+ `[[<-`(ns , " .rs.api.launcher.getInfo" , function () list (clusters = list (list (name = " Kubernetes" , defaultImage = " 1.a.b.reg.prov.com/int-r-sess:ubuntu2204-20250609" ))))
69+ `[[<-`(ns , " .rs.api.launcher.newContainer" , function (image ) image )
70+ `[[<-`(ns , " .rs.api.launcher.submitJob" , function (... ) NULL )
71+ attach(ns , name = " tools:rstudio" )
72+ cfg <- cloud_config(platform = " posit" )
73+ test_type(" list" , cfg )
74+ test_zero(daemons(url = local_url(), dispatcher = FALSE ))
75+ test_class(" miraiLaunchCmd" , launch_remote(n = 2L , remote = cfg ))
76+ test_zero(daemons(0 ))
77+ detach()
78+ test_error(cloud_config(platform = " posit" ), " can only be used from Posit Workbench" )
79+ }
7280# mirai and daemons tests
7381connection && {
7482 Sys.sleep(1L )
0 commit comments