Repository navigation
refactor(e2e): share detached cleanup context helper - #1685
Conversation
✅ Deploy Preview for devsydev canceled.
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Add shared cleanup context helper e2e/framework/command.go |
Adds DetachedCleanupContext and uses it in CleanupWorkspace with a one-minute timeout. |
Use helper in microsandbox cleanup callbacks e2e/tests/up/microsandbox_session.go, e2e/tests/up/provider_microsandbox_compatibility.go, e2e/tests/up/provider_microsandbox_consumer_linux.go, e2e/tests/up/provider_microsandbox_egress.go, e2e/tests/up/provider_microsandbox_ephemeral.go, e2e/tests/up/provider_microsandbox_migration.go, e2e/tests/up/provider_microsandbox_mounts.go, e2e/tests/up/provider_microsandbox_recreate.go, e2e/tests/up/provider_microsandbox_remote_agent_linux.go |
Replaces inline detached timeout construction with the helper. Cleanup operations and their timeout values remain unchanged. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Refactor
Merge Risk: 
Minimal · up to 61174
-
The refactor centralizes cleanup-context creation without changing the reported timeouts or cleanup behavior.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title "refactor(e2e): share detached cleanup context helper" follows Conventional Commits form and matches the main change: adding the exported framework.DetachedCleanupContext helper and routing the microsandbox e2e cleanup sites through it. It is short, specific, and accurately names the refactor type and scope.
Full details: Description check
-
Explanation
The description clearly explains the change, its rationale, and validation results. It omits the template’s issue reference, type-of-change and AI-assistance sections, checklist, and manual verification details, but the main information is complete.
-
-
Finishing Touches
-
✨ Simplify code
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
✅ Deploy Preview for images-devsy-sh canceled.
|
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
Summary
framework.DetachedCleanupContext(parent, timeout), wrappingcontext.WithTimeout(context.WithoutCancel(parent), timeout).CleanupWorkspace.Why
The bounded, detached cleanup context pattern was repeated about 20 times across
e2e/tests/up, with its rationale documented only once. The helper centralizes that intent and prevents Ginkgo cleanup from inheriting an expired spec context and silently skipping cleanup.Validation
mise run cli:format: clean.mise run cli:lint:ci: 0 issues.go vet ./e2e/...: pass.go test ./e2e/framework/...: pass.ginkgo --dry-run ./e2e/tests/up/: passed.61174960d: all 110 checks passed; the affectedup-provider-microsandbox,-images,-ephemeral,-storage,-managed-recreate,-resources,-logs-cancel, and-prebuildsjobs passed on ubuntu-latest.CodeRabbit
Auto-merge
e2e/, changes no coverage, and has 16 changed non-test source lines across 10 files (54 changed test lines; 43 weighted lines under the E2E half-weight rule).Next
tests/up/provider_kubernetes_ssh_agent.go(7 sites),tests/up/provider_kubernetes_dockerless_path.go:109,tests/up/fixture_command.go:58,tests/up/provider_microsandbox_logs_cancel.go(cleanup-like bounds, not migrated).