Repository navigation
test(e2e): migrate device auth health to vitest - #5543
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
|
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 new live Vitest e2e test file ChangesDevice Auth Health Vitest Migration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
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 |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
E2E Advisor RecommendationRequired E2E: None Dispatch hint: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: Dispatch required Vitest E2E scenarios:
Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
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/device-auth-health.test.ts`:
- Around line 233-239: The recovery status validation in the nemoclaw status
check only validates the output text does not contain offline but does not
verify that the nemoclaw command itself succeeded. Update the test to check that
the recoveryStatus indicates successful command execution (verify the exit code
or success property) in addition to calling assertStatusNotOffline on the
result. This ensures that a failed nemoclaw status command does not silently
pass the recovery check.
🪄 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: 1141229f-aedd-4378-9701-4501bbbd4efc
📒 Files selected for processing (2)
.github/workflows/e2e-vitest-scenarios.yamltest/e2e-scenario/live/device-auth-health.test.ts
PR Review AdvisorFindings: 0 needs attention, 7 worth checking, 0 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Consider writing more tests for
Since last review detailsCurrent findings:
This is an automated advisory review. A human maintainer must make the final merge decision. |
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…lth' into e2e-migrate/test-device-auth-health
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
…lth' into e2e-migrate/test-device-auth-health Signed-off-by: Carlos Villela <cvillela@nvidia.com>
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/device-auth-health.scenario.ts`:
- Around line 222-230: The current pkill command with the || true fallback can
silently fail without actually killing the gateway process, while still passing
the test and allowing the recovery phase to succeed without exercising the
intended disruption path. Remove the || true fallback from the pkill command in
the trustedSandboxShellScript call and add explicit validation to verify that
the gateway process was actually killed before proceeding with recovery polling.
This ensures the test truly exercises the kill and recovery contract rather than
allowing false positives where no actual disruption occurred.
🪄 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: 9e4cf8f8-36be-433f-be56-512626cb773b
📒 Files selected for processing (2)
test/e2e-scenario/live/device-auth-health.scenario.tstest/e2e-scenario/live/device-auth-health.test.ts
✅ Files skipped from review due to trivial changes (1)
- test/e2e-scenario/live/device-auth-health.test.ts
| await sandbox.execShell( | ||
| SANDBOX_NAME, | ||
| trustedSandboxShellScript("pkill -f 'openclaw.*gateway' 2>/dev/null || true"), | ||
| { | ||
| artifactName: "phase-5-kill-gateway-process", | ||
| env: commandEnv(), | ||
| timeoutMs: 30_000, | ||
| }, | ||
| ); |
There was a problem hiding this comment.
Validate that gateway kill actually happened before recovery polling
The current kill command (pkill ... || true) can no-op and still pass, so the recovery phase can succeed without exercising the disruption path. That makes this scenario capable of false positives for the kill/recovery contract.
Suggested fix
- await sandbox.execShell(
- SANDBOX_NAME,
- trustedSandboxShellScript("pkill -f 'openclaw.*gateway' 2>/dev/null || true"),
- {
- artifactName: "phase-5-kill-gateway-process",
- env: commandEnv(),
- timeoutMs: 30_000,
- },
- );
+ // Uses fixture helper that verifies the process tree is actually gone.
+ await sandbox.killGatewayTree(SANDBOX_NAME, {
+ artifactName: "phase-5-kill-gateway-process",
+ timeoutMs: 30_000,
+ });🤖 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-scenario/live/device-auth-health.scenario.ts` around lines 222 -
230, The current pkill command with the || true fallback can silently fail
without actually killing the gateway process, while still passing the test and
allowing the recovery phase to succeed without exercising the intended
disruption path. Remove the || true fallback from the pkill command in the
trustedSandboxShellScript call and add explicit validation to verify that the
gateway process was actually killed before proceeding with recovery polling.
This ensures the test truly exercises the kill and recovery contract rather than
allowing false positives where no actual disruption occurred.
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Migrates
test/e2e/test-device-auth-health.shinto a typed live Vitest scenario. The new coverage preserves the #2342 device-auth health contract through real install.sh onboard, sandbox HTTP probes, host port-forward probing,nemoclaw status, and gateway recovery checks.Related Issue
Refs #5098
Changes
test/e2e-scenario/live/device-auth-health.test.tswith typed artifact capture, cleanup, and secret redaction.device-auth-health-vitestinto.github/workflows/e2e-vitest-scenarios.yamlas a free-standing dispatchable Vitest job.Type of Change
Verification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Targeted commands run:
npx biome check --write test/e2e-scenario/live/device-auth-health.test.tsNEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project e2e-scenarios-live test/e2e-scenario/live/device-auth-health.test.ts -t __compile_only_nomatch__ --silent=false --reporter=default --passWithNoTestsnpx vitest run --project e2e-vitest-support test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.tsnpx tsx scripts/check-test-file-size-budget.ts test/e2e-scenario/live/device-auth-health.test.tsSigned-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
Tests
/healthand dashboard availability checks, health status validation (including after a simulated gateway outage), and recovery verification.CI / Release Operations