Repository navigation
test(e2e): add gateway drift preflight guard for #3423 - #3463
Conversation
E2E Advisor RecommendationRequired E2E: Dispatch hint: Full advisor summaryPi Semantic E2E AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a new ChangesGateway Drift Preflight E2E Test
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/e2e/test-gateway-drift-preflight.sh`:
- Around line 186-190: The test currently treats a zero exit code from
backup-all as non-fatal by calling info; change the branch so a successful
(rc==0) exit fails the test instead: when checking the variable rc after running
backup-all, replace the info branch with a failing action (e.g. call the test
harness fail function or echo an error and exit 1) so that a 0 exit causes the
script to error; reference the existing rc variable and the pass/info helpers
around the backup-all invocation to locate where to swap info for fail/exit.
- Around line 208-210: The current check using grep -qx 'sandbox list' against
"$CASE_DIR/openshell-calls.log" is too strict and misses invocations that
include arguments; update the check in test/e2e/test-gateway-drift-preflight.sh
to use a regex-based grep that anchors "sandbox list" at line start but allows
trailing whitespace/arguments (e.g., use grep -qE with a pattern like '^sandbox
list' plus allowance for space/args) so any call to the sandbox list command
with parameters is caught, keeping the existing fail "sandbox list was called
despite preflight image drift" behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: d06da98f-d4e3-4adc-9709-c839576c2658
📒 Files selected for processing (2)
.github/workflows/regression-e2e.yamltest/e2e/test-gateway-drift-preflight.sh
| if [ "$rc" -ne 0 ]; then | ||
| pass "backup-all exits non-zero on protobuf mismatch" | ||
| else | ||
| info "backup-all exited 0; checking that it did not silently treat the RPC failure as stopped" | ||
| fi |
There was a problem hiding this comment.
Enforce non-zero exit in the protobuf mismatch case.
Line 189 currently logs info and continues when backup-all exits 0, which can let this guard pass on an unexpected success path.
Suggested fix
if [ "$rc" -ne 0 ]; then
pass "backup-all exits non-zero on protobuf mismatch"
else
- info "backup-all exited 0; checking that it did not silently treat the RPC failure as stopped"
+ fail "backup-all unexpectedly exited 0 on protobuf mismatch"
fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if [ "$rc" -ne 0 ]; then | |
| pass "backup-all exits non-zero on protobuf mismatch" | |
| else | |
| info "backup-all exited 0; checking that it did not silently treat the RPC failure as stopped" | |
| fi | |
| if [ "$rc" -ne 0 ]; then | |
| pass "backup-all exits non-zero on protobuf mismatch" | |
| else | |
| fail "backup-all unexpectedly exited 0 on protobuf mismatch" | |
| fi |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/e2e/test-gateway-drift-preflight.sh` around lines 186 - 190, The test
currently treats a zero exit code from backup-all as non-fatal by calling info;
change the branch so a successful (rc==0) exit fails the test instead: when
checking the variable rc after running backup-all, replace the info branch with
a failing action (e.g. call the test harness fail function or echo an error and
exit 1) so that a 0 exit causes the script to error; reference the existing rc
variable and the pass/info helpers around the backup-all invocation to locate
where to swap info for fail/exit.
| if grep -qx 'sandbox list' "$CASE_DIR/openshell-calls.log"; then | ||
| fail "sandbox list was called despite preflight image drift" | ||
| fi |
There was a problem hiding this comment.
sandbox list assertion is too narrow and can miss real calls.
Line 208 only matches the exact string sandbox list; calls with arguments won’t be detected.
Suggested fix
-if grep -qx 'sandbox list' "$CASE_DIR/openshell-calls.log"; then
+if grep -qE '^sandbox list($|[[:space:]])' "$CASE_DIR/openshell-calls.log"; then
fail "sandbox list was called despite preflight image drift"
fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if grep -qx 'sandbox list' "$CASE_DIR/openshell-calls.log"; then | |
| fail "sandbox list was called despite preflight image drift" | |
| fi | |
| if grep -qE '^sandbox list($|[[:space:]])' "$CASE_DIR/openshell-calls.log"; then | |
| fail "sandbox list was called despite preflight image drift" | |
| fi |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/e2e/test-gateway-drift-preflight.sh` around lines 208 - 210, The current
check using grep -qx 'sandbox list' against "$CASE_DIR/openshell-calls.log" is
too strict and misses invocations that include arguments; update the check in
test/e2e/test-gateway-drift-preflight.sh to use a regex-based grep that anchors
"sandbox list" at line start but allows trailing whitespace/arguments (e.g., use
grep -qE with a pattern like '^sandbox list' plus allowance for space/args) so
any call to the sandbox list command with parameters is caught, keeping the
existing fail "sandbox list was called despite preflight image drift" behavior.
Recognize locally patched nemoclaw-cluster image tags when comparing the running OpenShell gateway image with the installed CLI version. Also hardens the regression guard shims so the fake Docker command survives NemoClaw's subprocess environment filtering. Related: NVIDIA#3423 NVIDIA#3463
Summary
Adds a failing-test-first regression guard for #3423 / #3399 in the dedicated
regression-e2e.yamlholding pen.The guard exercises the CLI boundary with fake
openshellanddockershims so it catches the real failure mode that unit-level mocks can miss:openshell sandbox listexits non-zero with the [Ubuntu 24.04][Upgrade] v0.0.38 → v0.0.39 in-place upgrade breaks CLI ↔ cluster RPC with protobuf "invalid wire type" decode error #3399 protobufinvalid wire typedecode error.nemoclaw-cluster:0.0.36-fuse-overlayfs-aa8b8487while installed OpenShell is0.0.37.Expected red/green behavior
gateway-drift-preflight-e2efails because NemoClaw either treats the protobuf failure as a stopped sandbox or misses the patched-image drift.Regression workflow
This is not added to scheduled nightly. It lives in
.github/workflows/regression-e2e.yamland can be dispatched explicitly:Verification
bash -n test/e2e/test-gateway-drift-preflight.shbash test/e2e/test-gateway-drift-preflight.shcurrently fails on the expected missing fail-closed guidance (red guard) before fix(cli): fail closed on OpenShell gateway drift #3423 lands.Related: #3423
Summary by CodeRabbit
Tests
Chores