From 8155f1498836b41464f88dd31942e33788197637 Mon Sep 17 00:00:00 2001 From: Drew Newberry Date: Thu, 20 Aug 2026 17:43:15 -0700 Subject: [PATCH] test(e2e): align detached sandbox assertions Signed-off-by: Drew Newberry --- e2e/rust/tests/oidc_pkce.rs | 6 ++---- e2e/rust/tests/workspace_namespace_managed.rs | 15 +++------------ e2e/rust/tests/workspace_namespace_operator.rs | 7 +------ 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/e2e/rust/tests/oidc_pkce.rs b/e2e/rust/tests/oidc_pkce.rs index 9ab684886..e6f6067a3 100644 --- a/e2e/rust/tests/oidc_pkce.rs +++ b/e2e/rust/tests/oidc_pkce.rs @@ -1388,6 +1388,7 @@ async fn assert_can_create_sandbox(session: &LoginSession, workspace: &str, sand "--name", sandbox_name, "--no-tty", + "--detach", "--", "sh", "-c", @@ -1412,10 +1413,6 @@ async fn assert_can_create_sandbox(session: &LoginSession, workspace: &str, sand let list_output = combined_output(&list); let cleanup = run_workspace_cli(session, workspace, &["sandbox", "delete", sandbox_name]).await; - assert!( - create_output.contains(&marker), - "sandbox command output should contain {marker}:\n{create_output}" - ); assert!( list.status.success() && list_output.contains(sandbox_name), "created sandbox {sandbox_name} should appear in the sandbox list:\n{list_output}" @@ -1438,6 +1435,7 @@ async fn assert_can_delete_sandbox(session: &LoginSession, workspace: &str, sand "--name", sandbox_name, "--no-tty", + "--detach", "--", "sh", "-c", diff --git a/e2e/rust/tests/workspace_namespace_managed.rs b/e2e/rust/tests/workspace_namespace_managed.rs index 70d6ea96a..b6d0555f3 100644 --- a/e2e/rust/tests/workspace_namespace_managed.rs +++ b/e2e/rust/tests/workspace_namespace_managed.rs @@ -148,6 +148,7 @@ async fn managed_creates_namespace_with_labels() { &ws, "--name", "mgd-sb", + "--detach", "--", "sh", "-c", @@ -157,10 +158,6 @@ async fn managed_creates_namespace_with_labels() { ]) .await; assert!(ok, "sandbox create failed: {out}"); - assert!( - out.contains("managed-ok"), - "sandbox output missing expected string: {out}" - ); // Verify the managed namespace was created. let (ok, out) = kubectl(&["get", "namespace", &ns]).await; @@ -460,6 +457,7 @@ async fn managed_workspace_delete_removes_namespace() { &ws, "--name", "del-sb", + "--detach", "--", "sh", "-c", @@ -469,10 +467,6 @@ async fn managed_workspace_delete_removes_namespace() { ]) .await; assert!(ok, "sandbox create failed: {out}"); - assert!( - out.contains("del-ok"), - "sandbox output missing expected string: {out}" - ); let (ok, _) = kubectl(&["get", "namespace", &ns]).await; assert!( @@ -535,6 +529,7 @@ async fn managed_tls_secret_copied_to_namespace() { &ws, "--name", "tls-sb", + "--detach", "--", "sh", "-c", @@ -544,10 +539,6 @@ async fn managed_tls_secret_copied_to_namespace() { ]) .await; assert!(ok, "sandbox create failed: {out}"); - assert!( - out.contains("tls-ok"), - "sandbox output missing expected string: {out}" - ); let (ok, out) = kubectl(&["get", "secret", "openshell-client-tls", "-n", &ns]).await; assert!( diff --git a/e2e/rust/tests/workspace_namespace_operator.rs b/e2e/rust/tests/workspace_namespace_operator.rs index c393711a1..315587bac 100644 --- a/e2e/rust/tests/workspace_namespace_operator.rs +++ b/e2e/rust/tests/workspace_namespace_operator.rs @@ -162,7 +162,6 @@ async fn operator_sandbox_in_labeled_namespace() { // Poll until the gateway's namespace watcher discovers the labeled namespace // and sandbox creation succeeds (up to 30s). - let mut sandbox_out = String::new(); let deadline = tokio::time::Instant::now() + Duration::from_secs(30); loop { let (ok, out) = run_cli(&[ @@ -172,6 +171,7 @@ async fn operator_sandbox_in_labeled_namespace() { &ns, "--name", "op-sb", + "--detach", "--", "sh", "-c", @@ -181,7 +181,6 @@ async fn operator_sandbox_in_labeled_namespace() { ]) .await; if ok { - sandbox_out = out; break; } if tokio::time::Instant::now() >= deadline { @@ -189,10 +188,6 @@ async fn operator_sandbox_in_labeled_namespace() { } tokio::time::sleep(Duration::from_secs(2)).await; } - assert!( - sandbox_out.contains("operator-ok"), - "sandbox output missing expected string: {sandbox_out}" - ); // Verify the sandbox CR lives in the pre-provisioned namespace. let (ok, out) = kubectl(&["get", "sandbox.agents.x-k8s.io", "-n", &ns, "-o", "name"]).await;