Skip to content

refactor(e2e): add CopyTestdataNoChdir helper - #1579

Merged
skevetter merged 1 commit into
mainfrom
refactor/e2e-copy-testdata-no-chdir
Oct 19, 2026
Merged

skevetter merged 1 commit into
mainfrom
refactor/e2e-copy-testdata-no-chdir

Conversation

@skevetter

@skevetter skevetter commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add framework.CopyTestdataNoChdir(testdataPath string) string. It copies via CopyToTempDirWithoutChdir, asserts no error, and registers an os.RemoveAll cleanup. It does not chdir.
  • Replace the identical copy/error/RemoveAll block at 21 call sites: extends (11) and configread (10).

Why

  • Removes 21 duplicated blocks. Spec count and names are unchanged (503 in the ./e2e suite).
  • Not migrated: tunnel (2), logs (1), machineprovider (3). They use ginkgo.DeferCleanup(framework.CleanupTempDir, ...), which chdirs to initialDir before removal. That cleanup differs, so these callers stay unchanged.

Validation

  • gofmt -l e2e/ clean. go build ./e2e/... and go vet ./e2e/... pass. go test ./e2e/framework/... passes.
  • golangci-lint run ./e2e/...: 54 issues, the same count as origin/main. None are new.
  • Ginkgo dry-run: 503 specs before and after, names identical.
  • Local run, --label-filter "extends || config-read" with dev build: 32/32 passed.

CodeRabbit CLI

  • Failed twice with Connection failed: WebSocket closed (recoverable). No findings were returned.

Auto-merge

  • Eligible: yes, pending CI. Changed files: 3.
  • Non-test changed lines: 10 source (helper) + 124 spec lines. Spec lines are half-weighted (about 62), so the weighted total is about 72.
  • CI jobs expected to exercise the changed paths: extends and config-read. Tunnel, logs, and machineprovider callers are untouched.

Next

  • Review CI results. No merge performed.

Summary by CodeRabbit

  • Tests
    • Updated end-to-end tests for configuration reading and inheritance scenarios. Fixture setup is now handled consistently across these cases, while existing commands, assertions, error expectations, and environment-variable scenarios remain unchanged. OCI-based tests are unaffected, and this update does not change application behavior.

@skevetter skevetter added the e2e-refactor e2e refactor label Oct 19, 2026
@netlify

netlify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

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

@coderabbitai

coderabbitai Bot commented Oct 19, 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: c5a515fa-dc51-4237-8b8d-a83d8f9bcb4e
📥 Commits

Reviewing files that changed from the base of the PR and between 2b30bfa and c7855d3.

📒 Files selected for processing: 3
  • e2e/framework/workspace.go
  • e2e/tests/configread/configread.go
  • e2e/tests/extends/extends.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

A shared helper now copies test fixtures to temporary directories without changing the working directory and registers cleanup. Config-read and extends E2E tests use the helper instead of repeating fixture-copy error handling and cleanup.

Changes: E2E fixture setup

Layer / File(s) Summary
Shared fixture-copy helper
e2e/framework/workspace.go
Adds CopyTestdataNoChdir to copy test data without changing directories, report copy errors, register temporary-directory cleanup, and return the path.
E2E test fixture setup
e2e/tests/configread/configread.go, e2e/tests/extends/extends.go
Uses the shared helper in config-read and extends tests. Existing assertions and error expectations remain; environment-variable setup and cleanup in the extends tests remain.

Priority: ⬇️ Low

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

Change: Refactor

Merge Risk: ⚪ Minimal · up to c7855

The fixture setup is centralized without a concrete regression identified in the supplied review context. The change is mergeable subject to normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description explains the change, rationale, affected call sites, validation results, and known limitations. It does not follow the required template because it omits the Type of change, AI assista… Update the description to include the required template sections. Mark Refactor (no behavior change), document AI tool usage or select no AI tools, complete the required acknowledgment checkboxes, identify the applicable testing option, and…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary refactor: adding the CopyTestdataNoChdir helper.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files.
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: Description check

Explanation

The description explains the change, rationale, affected call sites, validation results, and known limitations. It does not follow the required template because it omits the Type of change, AI assistance, Checklist, and Notes for reviewers sections, and it does not state an issue reference such as "Fixes none" or "Refs none".

Resolution

Update the description to include the required template sections. Mark Refactor (no behavior change), document AI tool usage or select no AI tools, complete the required acknowledgment checkboxes, identify the applicable testing option, and complete the Checklist. State "Fixes none" or provide the relevant issue reference.

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

❤️ Share

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

@netlify

netlify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit c7855d3
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6ad5bdd69f70783d9f9be46b

@skevetter
skevetter marked this pull request as ready for review October 19, 2026 08:34
@mergify

mergify Bot commented Oct 19, 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 95a4699 into main Oct 19, 2026
111 checks passed
@skevetter
skevetter deleted the refactor/e2e-copy-testdata-no-chdir branch October 19, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant