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
e2e (Ginkgo fixtures): dedupe the testdata copy/cleanup pattern into framework.
Change
Adds framework.CopyTestdata(testdataPath, initialDir string) string in e2e/framework/workspace.go. It calls CopyToTempDir, asserts the error with ExpectNoErrorWithOffset(1, err), registers ginkgo.DeferCleanup(CleanupTempDir, initialDir, tempDir), and returns tempDir.
Migrates exact matches of the three-line block (CopyToTempDir + ExpectNoError + DeferCleanup(CleanupTempDir, ...)) in e2e/tests/{build,provider,rename,snapshot,up-features}. 6 files, +126 / -195.
Not migrated, by design: sites whose cleanup is a closure that does more work (e.g. ssh/ssh_tunnel_mode.go, which also deletes the workspace), CopyToTempDirWithoutChdir sites, and SetupDockerWorkspace. Those are left for a separate decision.
Behaviour is unchanged: CopyTestdata still calls CopyToTempDir (same cwd change, same cleanup order), and no labels or specs were added, removed, or renamed.
Verification run
go build -gcflags=-e ./e2e/... and go vet ./e2e/...: clean.
mise run cli:format and mise run cli:lint:ci: 0 issues.
go test -count=1 ./e2e/framework/...: pass.
go run github.com/onsi/ginkgo/v2/ginkgo --dry-run --no-color ./e2e (root suite), run against a git worktree of origin/main and against this branch: Ran 503 of 503 Specs on both.
Not run: per-package ginkgo dry-runs, the --json-report label-coverage check, real e2e execution (needs Docker/kind), actionlint (no workflow changes).
CI jobs that exercise this change
From the include: matrix in .github/workflows/pr-ci.yml, matched by label name only (path filters and label-filter selection were not checked):
up-features: ubuntu-latest and windows-latest
provider: ubuntu-latest and windows-latest
snapshot: ubuntu-latest
build: ubuntu-latest
rename: ubuntu-latest
No workflow files changed. Draft PR; not merged.
Summary by CodeRabbit
Tests
Standardized temporary workspace setup and cleanup across build, provider, rename, snapshot, and feature end-to-end tests.
Test fixtures are removed automatically after use, and the working directory is restored.
Existing test scenarios and checks remain in place.
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: d35ce348-b4df-4229-ac54-48cbdd17a531
📥 Commits
Reviewing files that changed from the base of the PR and between e0fe773 and 24f741f.
📒 Files selected for processing: 6
e2e/framework/workspace.go
e2e/tests/build/build.go
e2e/tests/provider/provider.go
e2e/tests/rename/rename.go
e2e/tests/snapshot/snapshot.go
e2e/tests/up-features/up_features.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
The E2E framework adds CopyTestdata to copy fixtures and register cleanup. Build, provider, rename, snapshot, and feature tests use it with initialDir instead of managing fixture copies and temporary-directory cleanup separately.
CopyTestdata copies test data, reports copy errors, registers cleanup, and returns the temporary directory path.
Update build test fixtures e2e/tests/build/build.go
Docker, Compose, and Kubernetes build tests use CopyTestdata with initialDir instead of checked CopyToTempDir calls and explicit temporary-directory cleanup.
Update provider and rename test fixtures e2e/tests/provider/provider.go, e2e/tests/rename/rename.go
Provider and workspace rename tests use CopyTestdata with initialDir and remove separate fixture-copy error checks and cleanup registrations.
Update snapshot test fixtures e2e/tests/snapshot/snapshot.go
Snapshot tests use CopyTestdata for fixtures and remove explicit temporary-directory cleanup registrations.
Update feature test fixtures e2e/tests/up-features/up_features.go
Feature tests use CopyTestdata with initialDir and remove separate fixture-copy error checks and cleanup registrations. The integrity test still restores the working directory before its second copy.
The fixture refactor preserves the described copy and cleanup behavior, and no concrete issue remains that should block merging after ordinary checks.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 6 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely identifies the main change: adding the CopyTestdata fixture helper for E2E tests.
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.
Fix all pre-merge checks with AI
✨ 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.
Theme
e2e (Ginkgo fixtures): dedupe the testdata copy/cleanup pattern into
framework.Change
framework.CopyTestdata(testdataPath, initialDir string) stringine2e/framework/workspace.go. It callsCopyToTempDir, asserts the error withExpectNoErrorWithOffset(1, err), registersginkgo.DeferCleanup(CleanupTempDir, initialDir, tempDir), and returnstempDir.CopyToTempDir+ExpectNoError+DeferCleanup(CleanupTempDir, ...)) ine2e/tests/{build,provider,rename,snapshot,up-features}. 6 files, +126 / -195.ssh/ssh_tunnel_mode.go, which also deletes the workspace),CopyToTempDirWithoutChdirsites, andSetupDockerWorkspace. Those are left for a separate decision.CopyTestdatastill callsCopyToTempDir(same cwd change, same cleanup order), and no labels or specs were added, removed, or renamed.Verification run
go build -gcflags=-e ./e2e/...andgo vet ./e2e/...: clean.mise run cli:formatandmise run cli:lint:ci: 0 issues.go test -count=1 ./e2e/framework/...: pass.go run github.com/onsi/ginkgo/v2/ginkgo --dry-run --no-color ./e2e(root suite), run against agit worktreeoforigin/mainand against this branch:Ran 503 of 503 Specson both.coderabbit review --uncommitted --base origin/main --agent: completed, 0 findings, reviewed the 6 changed files.Not run: per-package ginkgo dry-runs, the
--json-reportlabel-coverage check, real e2e execution (needs Docker/kind),actionlint(no workflow changes).CI jobs that exercise this change
From the
include:matrix in.github/workflows/pr-ci.yml, matched by label name only (path filters and label-filter selection were not checked):up-features: ubuntu-latest and windows-latestprovider: ubuntu-latest and windows-latestsnapshot: ubuntu-latestbuild: ubuntu-latestrename: ubuntu-latestNo workflow files changed. Draft PR; not merged.
Summary by CodeRabbit