test(destroy): cover sandbox destroy flow outcomes - #5476
Conversation
|
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 Vitest test file destroySandbox flow test suite
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 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 docstrings
🧪 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 Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: None Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
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
Since last review detailsCurrent findings:
This is an automated advisory review. A human maintainer must make the final merge decision. |
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 `@src/lib/actions/sandbox/destroy-flow.test.ts`:
- Around line 76-82: The mock implementation for runOpenshellSpy returns an
object with an output property, but the getSandboxDeleteOutcome function expects
a SpawnLikeResult with stdout and stderr properties. Update the mock return
statements in the runOpenshellSpy implementation to return stdout and stderr
instead of output. Change the first return statement to return { status:
options.deleteStatus ?? 0, stdout: options.deleteOutput ?? "", stderr: "" } and
the fallback return statement to return { status: 0, stdout: "", stderr: "" }.
🪄 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: 84125866-888d-4da6-8309-b50fe3dcfe88
📒 Files selected for processing (1)
src/lib/actions/sandbox/destroy-flow.test.ts
|
Addressed review feedback in the latest commit:
Validation rerun:
|
Summary
Adds focused destroySandbox flow coverage for successful teardown and delete-failure safety behavior. The tests exercise gateway selection, live sandbox deletion, host cleanup, registry/session cleanup, gateway cleanup, and the fail-fast path before local state is removed.
Changes
src/lib/actions/sandbox/destroy-flow.test.tswith a dist-style harness fordestroySandbox.Type of Change
Verification
npx prek run --from-ref main --to-ref HEADpassesnpx vitest run src/lib/actions/sandbox/destroy-flow.test.ts --project clinpx vitest run src/lib/actions/sandbox/destroy-flow.test.ts test/destroy-cleanup-sandbox-services.test.ts --project clinpx @biomejs/biome lint src/lib/actions/sandbox/destroy-flow.test.tsnpm run typecheck:clinpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Note: commit and push hooks were skipped for this test-only branch because the broad local hook suite has unrelated pre-existing CLI failures in this checkout; targeted tests and CLI typecheck passed.
Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit