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