You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(e2e): use CopyTestdata in ssh specs - #1546
Replaces manual framework.CopyToTempDir + framework.CleanupTempDir pairs with framework.CopyTestdata(path, initialDir) in six ssh specs. CopyTestdata already registers ginkgo.DeferCleanup(CleanupTempDir, ...), so the explicit cleanup lines in each spec's teardown are removed.
agent_forward.go: BeforeAll/AfterAll teardown converted to ginkgo.DeferCleanup. Registration order gives LIFO teardown: workspace delete, then temp dir, then mock agent.
Where err was previously declared by the CopyToTempDir line, the next assignment becomes err :=.
Scope
Behaviour-preserving. No changes outside e2e/tests/ssh/.
Not migrated: e2e/tests/ssh/ssh.go still uses the manual pairs (9 It bodies). It was outside the six-file scope and has nested err reuse that needs its own pass.
No ginkgo run against a live Devsy environment; the ssh suite needs Docker and a provider.
Summary by CodeRabbit
Tests
Improved setup and cleanup consistency across SSH end-to-end tests for agent forwarding, credentials, port forwarding, proxy commands, tunnel modes, and task cancellation.
Reduced the risk of leftover test resources or interference between test runs.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 2ad84d8b-d20c-49e0-a064-b712ec154234
📥 Commits
Reviewing files that changed from the base of the PR and between 69b82de and 21db026.
📒 Files selected for processing: 6
e2e/tests/ssh/agent_forward.go
e2e/tests/ssh/credentials_server_race.go
e2e/tests/ssh/ports_attributes.go
e2e/tests/ssh/proxy_command.go
e2e/tests/ssh/ssh_tunnel_mode.go
e2e/tests/ssh/task_cancel.go
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
📝 Walkthrough
SSH end-to-end tests now use CopyTestdata for workspace fixtures. Cleanup changes remove temporary-directory cleanup calls, retain workspace deletion, and defer SSH agent cleanup during setup.
Changes: SSH end-to-end test setup
Layer / File(s)
Summary
Fixture and workspace lifecycle e2e/tests/ssh/credentials_server_race.go, e2e/tests/ssh/ports_attributes.go, e2e/tests/ssh/proxy_command.go, e2e/tests/ssh/ssh_tunnel_mode.go, e2e/tests/ssh/task_cancel.go
These tests use CopyTestdata with initialDir instead of CopyToTempDir. Cleanup no longer calls CleanupTempDir; workspace deletion remains. The fallback test declares err locally.
Agent forwarding setup and cleanup e2e/tests/ssh/agent_forward.go
Setup starts the mock SSH agent before copying test data and defers agent and workspace cleanup. The AfterAll hook was removed.
The SSH test refactor centralizes fixture cleanup while preserving workspace deletion and mock-agent shutdown through setup failures. No material merge blocker remains.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title accurately and concisely describes the main change: replacing the SSH end-to-end test setup with CopyTestdata.
Docstring Coverage
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 6…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 6 files.
✨ 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces manual
framework.CopyToTempDir+framework.CleanupTempDirpairs withframework.CopyTestdata(path, initialDir)in six ssh specs.CopyTestdataalready registersginkgo.DeferCleanup(CleanupTempDir, ...), so the explicit cleanup lines in each spec's teardown are removed.agent_forward.go: BeforeAll/AfterAll teardown converted toginkgo.DeferCleanup. Registration order gives LIFO teardown: workspace delete, then temp dir, then mock agent.credentials_server_race.go,ports_attributes.go(3 sites),proxy_command.go,ssh_tunnel_mode.go(5 sites),task_cancel.go(2 sites): one-to-one swap.errwas previously declared by theCopyToTempDirline, the next assignment becomeserr :=.Scope
Behaviour-preserving. No changes outside
e2e/tests/ssh/.Not migrated:
e2e/tests/ssh/ssh.gostill uses the manual pairs (9Itbodies). It was outside the six-file scope and has nestederrreuse that needs its own pass.Validation
gofmt -l e2e/: cleango vet ./e2e/...: cleango test -c ./e2e/tests/ssh/: compilesmise run cli:lint:ci: 0 issues--uncommitted --base origin/main): completed, 0 findings across 6 filesNo ginkgo run against a live Devsy environment; the ssh suite needs Docker and a provider.
Summary by CodeRabbit