Skip to content

Commit dfb06e6

Browse files
authored
test(e2e): align detached sandbox assertions (#2856)
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent 0300e6d commit dfb06e6

3 files changed

Lines changed: 6 additions & 22 deletions

File tree

‎e2e/rust/tests/oidc_pkce.rs‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,7 @@ async fn assert_can_create_sandbox(session: &LoginSession, workspace: &str, sand
13881388
"--name",
13891389
sandbox_name,
13901390
"--no-tty",
1391+
"--detach",
13911392
"--",
13921393
"sh",
13931394
"-c",
@@ -1412,10 +1413,6 @@ async fn assert_can_create_sandbox(session: &LoginSession, workspace: &str, sand
14121413
let list_output = combined_output(&list);
14131414
let cleanup = run_workspace_cli(session, workspace, &["sandbox", "delete", sandbox_name]).await;
14141415

1415-
assert!(
1416-
create_output.contains(&marker),
1417-
"sandbox command output should contain {marker}:\n{create_output}"
1418-
);
14191416
assert!(
14201417
list.status.success() && list_output.contains(sandbox_name),
14211418
"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
14381435
"--name",
14391436
sandbox_name,
14401437
"--no-tty",
1438+
"--detach",
14411439
"--",
14421440
"sh",
14431441
"-c",

‎e2e/rust/tests/workspace_namespace_managed.rs‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ async fn managed_creates_namespace_with_labels() {
148148
&ws,
149149
"--name",
150150
"mgd-sb",
151+
"--detach",
151152
"--",
152153
"sh",
153154
"-c",
@@ -157,10 +158,6 @@ async fn managed_creates_namespace_with_labels() {
157158
])
158159
.await;
159160
assert!(ok, "sandbox create failed: {out}");
160-
assert!(
161-
out.contains("managed-ok"),
162-
"sandbox output missing expected string: {out}"
163-
);
164161

165162
// Verify the managed namespace was created.
166163
let (ok, out) = kubectl(&["get", "namespace", &ns]).await;
@@ -460,6 +457,7 @@ async fn managed_workspace_delete_removes_namespace() {
460457
&ws,
461458
"--name",
462459
"del-sb",
460+
"--detach",
463461
"--",
464462
"sh",
465463
"-c",
@@ -469,10 +467,6 @@ async fn managed_workspace_delete_removes_namespace() {
469467
])
470468
.await;
471469
assert!(ok, "sandbox create failed: {out}");
472-
assert!(
473-
out.contains("del-ok"),
474-
"sandbox output missing expected string: {out}"
475-
);
476470

477471
let (ok, _) = kubectl(&["get", "namespace", &ns]).await;
478472
assert!(
@@ -535,6 +529,7 @@ async fn managed_tls_secret_copied_to_namespace() {
535529
&ws,
536530
"--name",
537531
"tls-sb",
532+
"--detach",
538533
"--",
539534
"sh",
540535
"-c",
@@ -544,10 +539,6 @@ async fn managed_tls_secret_copied_to_namespace() {
544539
])
545540
.await;
546541
assert!(ok, "sandbox create failed: {out}");
547-
assert!(
548-
out.contains("tls-ok"),
549-
"sandbox output missing expected string: {out}"
550-
);
551542

552543
let (ok, out) = kubectl(&["get", "secret", "openshell-client-tls", "-n", &ns]).await;
553544
assert!(

‎e2e/rust/tests/workspace_namespace_operator.rs‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ async fn operator_sandbox_in_labeled_namespace() {
162162

163163
// Poll until the gateway's namespace watcher discovers the labeled namespace
164164
// and sandbox creation succeeds (up to 30s).
165-
let mut sandbox_out = String::new();
166165
let deadline = tokio::time::Instant::now() + Duration::from_secs(30);
167166
loop {
168167
let (ok, out) = run_cli(&[
@@ -172,6 +171,7 @@ async fn operator_sandbox_in_labeled_namespace() {
172171
&ns,
173172
"--name",
174173
"op-sb",
174+
"--detach",
175175
"--",
176176
"sh",
177177
"-c",
@@ -181,18 +181,13 @@ async fn operator_sandbox_in_labeled_namespace() {
181181
])
182182
.await;
183183
if ok {
184-
sandbox_out = out;
185184
break;
186185
}
187186
if tokio::time::Instant::now() >= deadline {
188187
panic!("sandbox create did not succeed within 30s: {out}");
189188
}
190189
tokio::time::sleep(Duration::from_secs(2)).await;
191190
}
192-
assert!(
193-
sandbox_out.contains("operator-ok"),
194-
"sandbox output missing expected string: {sandbox_out}"
195-
);
196191

197192
// Verify the sandbox CR lives in the pre-provisioned namespace.
198193
let (ok, out) = kubectl(&["get", "sandbox.agents.x-k8s.io", "-n", &ns, "-o", "name"]).await;

0 commit comments

Comments
 (0)