Skip to content

refactor(e2e): use CopyTestdata in ssh specs - #1546

Merged
skevetter merged 1 commit into
mainfrom
refactor/e2e-ssh-copytestdata
Oct 18, 2026
Merged

skevetter merged 1 commit into
mainfrom
refactor/e2e-ssh-copytestdata

Conversation

@skevetter

@skevetter skevetter commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

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.
  • 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.
  • 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.

Validation

  • gofmt -l e2e/: clean
  • go vet ./e2e/...: clean
  • go test -c ./e2e/tests/ssh/: compiles
  • mise run cli:lint:ci: 0 issues
  • CodeRabbit CLI (--uncommitted --base origin/main): completed, 0 findings across 6 files

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 user-facing behavior changes.

@skevetter skevetter added the ci-refactor CI/e2e refactor label Oct 18, 2026
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to 21db0

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: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately and concisely describes the main change: replacing the SSH end-to-end test setup with CopyTestdata.
Docstring Coverage Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 21db026
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6ad4bbb874c0970654f4a512

@netlify

netlify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 21db026
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6ad4bbb8bbe4aa8995d113cd

@skevetter
skevetter marked this pull request as ready for review October 18, 2026 13:31
@mergify

mergify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

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.

@skevetter
skevetter merged commit a54cb16 into main Oct 18, 2026
199 of 201 checks passed
@skevetter
skevetter deleted the refactor/e2e-ssh-copytestdata branch October 18, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-refactor CI/e2e refactor size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant