Skip to content

Commit 2f9ba13

Browse files
jyaunchesclaude
andcommitted
fix(test): pass --yes to destroy in E2E test to skip confirmation prompt
The destroy command prompts for confirmation interactively, which hangs in CI/headless environments. Pass --yes to skip the prompt. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 8cfc874 commit 2f9ba13

2 files changed

Lines changed: 31 additions & 28 deletions

File tree

‎scripts/e2e-brev-test.sh‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,18 @@ GREEN='\033[0;32m'
2222
YELLOW='\033[1;33m'
2323
NC='\033[0m'
2424

25-
info() { echo -e "${GREEN}[brev-e2e]${NC} $1"; }
26-
warn() { echo -e "${YELLOW}[brev-e2e]${NC} $1"; }
27-
fail() { echo -e "${RED}[brev-e2e]${NC} $1"; exit 1; }
25+
info() { echo -e "${GREEN}[brev-e2e]${NC} $1"; }
26+
warn() { echo -e "${YELLOW}[brev-e2e]${NC} $1"; }
27+
fail() {
28+
echo -e "${RED}[brev-e2e]${NC} $1"
29+
exit 1
30+
}
2831

2932
# ── Validate inputs ──────────────────────────────────────────────
30-
[ -n "${BREV_API_TOKEN:-}" ] || fail "BREV_API_TOKEN not set"
31-
[ -n "${NVIDIA_API_KEY:-}" ] || fail "NVIDIA_API_KEY not set"
32-
[ -n "${GITHUB_TOKEN:-}" ] || fail "GITHUB_TOKEN not set"
33-
[ -n "${INSTANCE_NAME:-}" ] || fail "INSTANCE_NAME not set"
33+
[ -n "${BREV_API_TOKEN:-}" ] || fail "BREV_API_TOKEN not set"
34+
[ -n "${NVIDIA_API_KEY:-}" ] || fail "NVIDIA_API_KEY not set"
35+
[ -n "${GITHUB_TOKEN:-}" ] || fail "GITHUB_TOKEN not set"
36+
[ -n "${INSTANCE_NAME:-}" ] || fail "INSTANCE_NAME not set"
3437

3538
TEST_SUITE="${TEST_SUITE:-full}"
3639
BREV_CPU="${BREV_CPU:-4x16}"
@@ -51,7 +54,7 @@ trap cleanup EXIT
5154
info "Authenticating with Brev..."
5255
# Pre-create onboarding marker to skip interactive first-run prompt
5356
mkdir -p "$HOME/.brev"
54-
echo '{"step":1,"hasRunBrevShell":true,"hasRunBrevOpen":true}' > "$HOME/.brev/onboarding_step.json"
57+
echo '{"step":1,"hasRunBrevShell":true,"hasRunBrevOpen":true}' >"$HOME/.brev/onboarding_step.json"
5558

5659
LOGIN_OUTPUT=$(brev login --token "$BREV_API_TOKEN" 2>&1) || {
5760
echo "$LOGIN_OUTPUT"

‎test/e2e/test-full-e2e.sh‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ SANDBOX_NAME="${NEMOCLAW_SANDBOX_NAME:-e2e-nightly}"
8686
section "Phase 0: Pre-cleanup"
8787
info "Destroying any leftover sandbox/gateway from previous runs..."
8888
if command -v nemoclaw >/dev/null 2>&1; then
89-
nemoclaw "$SANDBOX_NAME" destroy 2>/dev/null || true
89+
nemoclaw "$SANDBOX_NAME" destroy --yes 2>/dev/null || true
9090
fi
9191
if command -v openshell >/dev/null 2>&1; then
9292
openshell sandbox delete "$SANDBOX_NAME" 2>/dev/null || true
@@ -187,9 +187,9 @@ else
187187
exit 1
188188
fi
189189

190-
nemoclaw --help >/dev/null 2>&1 \
191-
&& pass "nemoclaw --help exits 0" \
192-
|| fail "nemoclaw --help failed"
190+
nemoclaw --help >/dev/null 2>&1 &&
191+
pass "nemoclaw --help exits 0" ||
192+
fail "nemoclaw --help failed"
193193

194194
# ══════════════════════════════════════════════════════════════════
195195
# Phase 3: Sandbox verification
@@ -198,9 +198,9 @@ section "Phase 3: Sandbox verification"
198198

199199
# 3a: nemoclaw list
200200
if list_output=$(nemoclaw list 2>&1); then
201-
echo "$list_output" | grep -Fq -- "$SANDBOX_NAME" \
202-
&& pass "nemoclaw list contains '${SANDBOX_NAME}'" \
203-
|| fail "nemoclaw list does not contain '${SANDBOX_NAME}'"
201+
echo "$list_output" | grep -Fq -- "$SANDBOX_NAME" &&
202+
pass "nemoclaw list contains '${SANDBOX_NAME}'" ||
203+
fail "nemoclaw list does not contain '${SANDBOX_NAME}'"
204204
else
205205
fail "nemoclaw list failed: ${list_output:0:200}"
206206
fi
@@ -216,23 +216,23 @@ fi
216216
# 3c: Inference must be configured by onboard (no fallback — if onboard
217217
# failed to configure it, that's a bug we want to catch)
218218
if inf_check=$(openshell inference get 2>&1); then
219-
echo "$inf_check" | grep -qi "nvidia-nim" \
220-
&& pass "Inference configured via onboard" \
221-
|| fail "Inference not configured — onboard did not set up nvidia-nim provider"
219+
echo "$inf_check" | grep -qi "nvidia-nim" &&
220+
pass "Inference configured via onboard" ||
221+
fail "Inference not configured — onboard did not set up nvidia-nim provider"
222222
else
223223
fail "openshell inference get failed: ${inf_check:0:200}"
224224
fi
225225

226226
# 3d: Policy presets applied
227227
if policy_output=$(openshell policy get --full "$SANDBOX_NAME" 2>&1); then
228-
echo "$policy_output" | grep -qi "network_policies" \
229-
&& pass "Policy applied to sandbox" \
230-
|| fail "No network policy found on sandbox"
228+
echo "$policy_output" | grep -qi "network_policies" &&
229+
pass "Policy applied to sandbox" ||
230+
fail "No network policy found on sandbox"
231231

232232
# Check that at least npm or pypi preset endpoints are present (onboard auto-suggests these)
233-
echo "$policy_output" | grep -qi "registry.npmjs.org\|pypi.org" \
234-
&& pass "Policy presets (npm/pypi) detected in sandbox policy" \
235-
|| skip "Could not confirm npm/pypi presets in policy (may vary by environment)"
233+
echo "$policy_output" | grep -qi "registry.npmjs.org\|pypi.org" &&
234+
pass "Policy presets (npm/pypi) detected in sandbox policy" ||
235+
skip "Could not confirm npm/pypi presets in policy (may vary by environment)"
236236
else
237237
fail "openshell policy get failed: ${policy_output:0:200}"
238238
fi
@@ -325,13 +325,13 @@ fi
325325
# ══════════════════════════════════════════════════════════════════
326326
section "Phase 6: Cleanup"
327327

328-
nemoclaw "$SANDBOX_NAME" destroy 2>&1 | tail -3 || true
328+
nemoclaw "$SANDBOX_NAME" destroy --yes 2>&1 | tail -3 || true
329329
openshell gateway destroy -g nemoclaw 2>/dev/null || true
330330

331331
list_after=$(nemoclaw list 2>&1)
332-
echo "$list_after" | grep -Fq -- "$SANDBOX_NAME" \
333-
&& fail "Sandbox ${SANDBOX_NAME} still in list after destroy" \
334-
|| pass "Sandbox ${SANDBOX_NAME} removed"
332+
echo "$list_after" | grep -Fq -- "$SANDBOX_NAME" &&
333+
fail "Sandbox ${SANDBOX_NAME} still in list after destroy" ||
334+
pass "Sandbox ${SANDBOX_NAME} removed"
335335

336336
# ══════════════════════════════════════════════════════════════════
337337
# Summary

0 commit comments

Comments
 (0)