@@ -45,15 +45,6 @@ test_true(grepl("5555", local_url(tcp = TRUE, port = 5555), fixed = TRUE))
4545test_type(" list" , ssh_config(" ssh://remotehost" ))
4646test_type(" list" , ssh_config(" ssh://remotehost" , tunnel = TRUE ))
4747test_type(" list" , cluster_config())
48- test_error(cloud_config(platform = " " ), " not supported" )
49- if (is.null(mirai ::: posit_tools())) {
50- test_error(cloud_config(platform = " posit" ), " can only be used from Posit Workbench" )
51- ns <- new.env(parent = emptyenv())
52- `[[<-`(ns , " .rs.api.launcher.jobsFeatureAvailable" , function () TRUE )
53- `[[<-`(ns , " .rs.api.launcher.getInfo" , function () list (clusters = list (list (name = " Kubernetes" , defaultImage = " 1.a.b.reg.prov.com/int-r-sess:ubuntu2204-20250609" ))))
54- attach(ns , name = " tools:rstudio" )
55- }
56- test_type(" list" , cloud_config(platform = " posit" ))
5748test_true(is_mirai_interrupt(r <- mirai ::: mk_interrupt_error()))
5849test_print(r )
5950test_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