test(e2e): migrate test-gateway-health-honest.sh to vitest#5351
Conversation
Reserve Phase 4 E2E migration work for test-gateway-health-honest.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:
📝 WalkthroughWalkthroughAdds a free-standing Vitest scenario job ChangesGateway Health Honesty Test Scenario and Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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 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: 27438091608
|
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/e2e-scenario/live/gateway-health-honest.test.ts`:
- Around line 174-178: The race between kill -0 and ps causes set -e to fail if
the PID exits before ps runs; update the state retrieval so ps failures don't
abort the script: when assigning state (the state="$(ps -p "$pid" -o state=
2>/dev/null | tr -d '[:space:]')") tolerate ps exit by making the ps pipeline
safe (e.g., append a fallback like "|| true" to the ps command or run a fresh
kill -0 check before calling ps) so state becomes empty if ps fails, then keep
the existing checks against "$state" and "Z" to consider the process gone.
🪄 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: ec9d52a3-d9ed-4de2-a9e9-bdf328e00ef9
📒 Files selected for processing (1)
test/e2e-scenario/live/gateway-health-honest.test.ts
Vitest E2E Scenario Results — ❌ Some jobs failedRun: 27445163219
|
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27445527506
|
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27449069808
|
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27452231429
|
…way-health-honest
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27453895057
|
…way-health-honest # Conflicts: # .github/workflows/e2e-vitest-scenarios.yaml # test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts
…honest' into e2e-migrate/test-gateway-health-honest # Conflicts: # .github/workflows/e2e-vitest-scenarios.yaml # test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts
…way-health-honest # Conflicts: # .github/workflows/e2e-vitest-scenarios.yaml # test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts # tools/e2e-scenarios/workflow-boundary.mts
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27455451041
|
…way-health-honest # Conflicts: # .github/workflows/e2e-vitest-scenarios.yaml # test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts # tools/e2e-scenarios/workflow-boundary.mts
…honest' into e2e-migrate/test-gateway-health-honest # Conflicts: # .github/workflows/e2e-vitest-scenarios.yaml # test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts # tools/e2e-scenarios/workflow-boundary.mts
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27457203127
|
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27458463357
|
Vitest E2E Scenario Results — ✅ All jobs passedRun: 27458565957
|
cv
left a comment
There was a problem hiding this comment.
CI is green, and I verified the CodeRabbit ps/kill race feedback is addressed in the current branch: the lingering-process check no longer runs under set -e/pipefail and treats a disappearing ps result as empty state. Targeted E2E/Vitest scenario gateway-health-honest-vitest also passed on run 27458565957 for the current head.
Summary
Migrate
test/e2e/test-gateway-health-honest.shwith the simplest equivalent Vitest coverage.Related Issues
Refs #5098
Refs #3111
Contract mapping
startGateway()must not printDocker-driver gateway is healthywhen the OpenShell Docker-driver gateway binary exits immediately with GLIBC-style stderr.test/e2e-scenario/live/gateway-health-honest.test.tsinvokes the real compiledstartGateway()path with a sabotagedopenshell-gatewaybinary and asserts non-zero exit, visible failure output, gateway-log sabotage evidence, and no false healthy message.startGateway()implementation, real OpenShell CLI metadata removal, real host child-process spawn, real Docker-driver gateway state/log path.Simplicity check
regression-e2e.yamljobgateway-health-honest-e2e,runs-on: ubuntu-latest, Node 22 + OpenShell install, no secrets required.ubuntu-latestrunner class ine2e-vitest-scenarios.yamljobgateway-health-honest-vitest.e2e-vitest-scenarios.yamlwithjobs=gateway-health-honest-viteston this PR branch.Verification
npm run build:cliNEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project e2e-scenarios-live test/e2e-scenario/live/gateway-health-honest.test.ts --silent=false --reporter=defaultnpx vitest run --project e2e-vitest-support test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts --silent=false --reporter=defaultgit diff --checkworkflow_dispatch,jobs=gateway-health-honest-vitest)Summary by CodeRabbit
New Features
Tests
Chores