test(e2e): migrate test-gateway-drift-preflight.sh to vitest#5350
Conversation
Reserve Phase 4 E2E migration work for test-gateway-drift-preflight.sh. Refs #5098
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR adds a gateway drift preflight Vitest E2E test that exercises fail-closed behavior when gateway schema or binary drift is detected, wires it as a free-standing CI job in ChangesGateway Drift Preflight E2E Test and CI Integration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
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 |
E2E Advisor RecommendationRequired E2E: None Full advisor summaryE2E Recommendation AdvisorFailed: Could not parse JSON from advisor output; see /home/runner/work/NemoClaw/NemoClaw/artifacts/e2e-advisor/e2e-advisor-raw-output.txt |
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: None Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorFailed: Could not parse JSON from advisor output; see /home/runner/work/NemoClaw/NemoClaw/artifacts/e2e-advisor/e2e-scenario-advisor-raw-output.txt |
PR Review AdvisorFindings: 0 needs attention, 1 worth checking, 0 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Consider writing more tests for
This is an automated advisory review. A human maintainer must make the final merge decision. |
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27438428046
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/gateway-drift-preflight.test.ts`:
- Around line 306-313: The current expectSandboxListCalled uses a literal
includes("sandbox list") which will miss invocations that add flags; update the
detection in expectSandboxListCalled to parse the openshell-calls.log lines and
test each line with a regex or startsWith check for the command name (e.g.,
match a pattern like word-boundary "sandbox" followed by whitespace and "list"
so trailing flags are allowed) instead of exact substring equality; change the
called assignment in expectSandboxListCalled to set true when any log line
matches that regex and keep the existing failure message and assertions.
🪄 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: e7c60aae-139d-4d6d-9c42-6cfcbd6ab16a
📒 Files selected for processing (5)
.github/workflows/e2e-vitest-scenarios.yamltest/e2e-scenario/support-tests/e2e-scenarios-workflow.test.tstest/gateway-drift-preflight.test.tstools/e2e-scenarios/free-standing-jobs.envtools/e2e-scenarios/workflow-boundary.mts
Vitest E2E Scenario Results — ❌ Some jobs failedRun: 27445160405
|
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27448614112
|
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27452322362
|
…way-drift-preflight
Summary
Migrate
test/e2e/test-gateway-drift-preflight.shwith the simplest equivalent Vitest coverage.Related Issues
Refs #5098
Refs #3399
Refs #3423
Contract mapping
test/gateway-drift-preflight.test.tsdrives the real repo CLI through fakeopenshell/dockerbinaries and asserts fail-closed diagnostics/no backup success.node bin/nemoclaw.js backup-all, PATH-resolvedopenshell sandbox list, fake process exit/output boundary, and filesystem registry state.openshell sandbox list.test/gateway-drift-preflight.test.tsfakes active Docker cluster inspect output and asserts image drift output plus no sandbox-list call.backup-allandupgrade-sandboxes --checkbefore sandbox-list.test/gateway-drift-preflight.test.tsseeds runtime markers/fallback binaries and invokes both real CLI commands./proc/process identity probe, and fallback binary resolution.test/gateway-drift-preflight.test.tsseeds a stale marker pointing at an old binary and asserts the CLI proceeds toopenshell sandbox list.Simplicity check
test/gateway-drift-preflight.test.ts.regression-e2e.yamljobgateway-drift-preflight-e2e,runs-on: ubuntu-latest, Node 22, fake Docker/OpenShell shims, no secrets.e2e-vitest-scenarios.yamljobgateway-drift-preflight-vitest,runs-on: ubuntu-latest, Node 22, no secrets.e2e-vitest-scenarios.yamlwithjobs=gateway-drift-preflight-viteston this PR branch.Verification
npm ci --ignore-scriptsnpm run build:clinpx vitest run --project cli test/gateway-drift-preflight.test.ts --silent=false --reporter=defaultnpx vitest run --project e2e-vitest-support test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.tsnpm run typecheck:cligit diff --checkNote: local full pre-push CLI suite was attempted by hooks but is not part of the focused migration validation and failed on unrelated local environment/pre-existing issues (
nemoclaw/node_modules/json5missing,nemoclaw/dist/blueprint/private-networks.jsmissing, macOS timeout/platform expectations). Focused migration validations above passed.Summary by CodeRabbit
New Features
Tests
Chores