Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix(sdk): gate the Unix-only exec -i signal test, format test_compile_lane (CUA-1949) (#5666)

ddupont7b590f5bc983
diff --git a/libs/cua/crates/cua-cli/tests/sandbox_do.rs b/libs/cua/crates/cua-cli/tests/sandbox_do.rs
index be14df3182..478669056d 100644
--- a/libs/cua/crates/cua-cli/tests/sandbox_do.rs
+++ b/libs/cua/crates/cua-cli/tests/sandbox_do.rs
@@ -121,6 +121,7 @@ async fn sandbox_lifecycle_exec_and_compat_aliases() {
])
.await;
assert_eq!(o.code, 4, "{o:?}");
+ #[cfg(unix)]
exec_stream_round_trip(&h, &env).await;
let o = h
.run(&["--embedded", "--json", "sb", "exec", "dev", "echo hi"])
@@ -1039,6 +1040,7 @@ async fn sandbox_info_connection_prints_the_spacesd_url_and_token() {
/// `sb exec -i` against the real binary: stdin round trip, signal
/// forwarding, and the guest process dying with a killed client.
+#[cfg(unix)]
async fn exec_stream_round_trip(h: &Home, env: &fixtures::SpacesdFixture) {
use tokio::io::{AsyncReadExt, AsyncWriteExt};
let mut child = h.spawn(&["--embedded", "sb", "exec", "-i", "dev", "--", "cat"]);
diff --git a/tests/e2e/cua-sdk/docs/test_compile_lane.py b/tests/e2e/cua-sdk/docs/test_compile_lane.py
index 15e2fdc4b4..18539fe73f 100644
--- a/tests/e2e/cua-sdk/docs/test_compile_lane.py
+++ b/tests/e2e/cua-sdk/docs/test_compile_lane.py
@@ -64,7 +64,11 @@ class CompileLaneTest(unittest.TestCase):
def test_rust_wrap(self):
whole = "use cua_sdk::Cua;\n\n#[tokio::main]\nasync fn main() {}\n"
self.assertEqual(cl.wrap(whole, "rust", "DocsR"), whole)
- out = cl.wrap("use cua_sdk::{Cua, CuaConfig};\n\nlet c = Cua::embedded(CuaConfig::default())?;\n", "rust", "DocsR")
+ out = cl.wrap(
+ "use cua_sdk::{Cua, CuaConfig};\n\nlet c = Cua::embedded(CuaConfig::default())?;\n",
+ "rust",
+ "DocsR",
+ )
lines = out.splitlines()
self.assertEqual(lines[:2], ["#![allow(unused)]", "use cua_sdk::{Cua, CuaConfig};"])
self.assertIn("async fn docs_r() -> Result<(), Box<dyn std::error::Error>> {", out)