Skip to content

refactor(e2e): share devcontainer fixture helper - #1484

Merged
skevetter merged 1 commit into
mainfrom
refactor/e2e-dedupe-devcontainer-fixture
Oct 14, 2026
Merged

skevetter merged 1 commit into
mainfrom
refactor/e2e-dedupe-devcontainer-fixture

Conversation

@skevetter

@skevetter skevetter commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Adds framework.WriteTempDevcontainer(prefix, content string) string in e2e/framework/util.go. It calls os.MkdirTemp("", prefix), MkdirAll(<tmp>/.devcontainer, 0o750), and WriteFile(<tmp>/.devcontainer/devcontainer.json, content, 0o600), with ExpectNoError on each step, and returns the temp dir.
  • Deletes the unexported writeDevcontainerJSON from e2e/tests/outdated/outdated.go and e2e/tests/upgrade/upgrade.go. The two copies were identical except for the MkdirTemp prefix.
  • Call sites now pass the prefix explicitly: outdated-test-* (3 call sites in outdated), upgrade-test-* (5 call sites in upgrade). Prefixes are unchanged.
  • Removes the now-unused path/filepath import from outdated.go. upgrade.go still uses filepath and os in readDevcontainerJSON.
  • Behaviour is unchanged. Cleanup is still the caller's job; the helper registers none, same as before.
  • Out of scope and untouched: e2e/tests/configapply (its writeDevcontainerJSON(dir, map) has a different signature), and the paths listed as having open PRs.

Why

The same fixture helper was duplicated in two e2e test packages. Moving it into the shared framework leaves one implementation.

Verification

  • gofmt -l on the three touched files: no output.
  • go vet ./e2e/framework/... ./e2e/tests/outdated/... ./e2e/tests/upgrade/...: exit 0.
  • go build ./e2e/framework/ ./e2e/tests/outdated/ ./e2e/tests/upgrade/: exit 0.
  • go test -count=1 -run '^$' ./e2e/tests/outdated/ ./e2e/tests/upgrade/: exit 0. Reports [no test files] because the Ginkgo specs live in non-_test.go files, so the compile check is covered by vet and build above.
  • task cli:format: changed only the three intended files.
  • task cli:lint:ci: 0 issues.
  • xd://lsp references for WriteTempDevcontainer: 9 hits (1 definition, 8 call sites: outdated 3, upgrade 5). No name clash in package framework.
  • Commit is signed (EDDSA key 7635B0B1F6CAD3B372E60A9550176882C873AF3D). Commit ran prek hooks; --no-verify was not used.

Not run locally: the e2e suite. It needs a built devsy binary and Docker.

CodeRabbit CLI

coderabbit review --agent --committed --base-commit c4e684cca5a293201c43d7262f20d97eb2f8a0ac: completed, findings: 0, reviewed e2e/framework/util.go, e2e/tests/outdated/outdated.go, e2e/tests/upgrade/upgrade.go. No findings skipped.

Summary by CodeRabbit

  • Tests
    • Temporary devcontainer fixtures are now set up consistently across the outdated-command and upgrade test suites.
    • The existing scenarios and expected results remain unchanged.
    • No end-user-facing functionality or behavior changes are included in this update.

The outdated and upgrade e2e packages each had an identical unexported writeDevcontainerJSON helper that differed only in the MkdirTemp prefix. Move it into the framework as WriteTempDevcontainer(prefix, content) and call it with the existing prefixes (outdated-test-*, upgrade-test-*). Permissions, error handling and return value are unchanged; cleanup is still the caller's responsibility.
@netlify

netlify Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev ready!

Name Link
🔨 Latest commit 5227cc8
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6acfa2bc05fc85884069e7d7
😎 Deploy Preview https://deploy-preview-1484--devsydev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Oct 14, 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: 805f6797-0108-4057-bfcb-d812ec57b665
📥 Commits

Reviewing files that changed from the base of the PR and between 904c504 and 5227cc8.

📒 Files selected for processing: 3
  • e2e/framework/util.go
  • e2e/tests/outdated/outdated.go
  • e2e/tests/upgrade/upgrade.go

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Walkthrough

The E2E framework adds a shared helper to create temporary devcontainer fixtures. The outdated and upgrade tests use the helper instead of their local fixture-writing functions. Their test scenarios and expectations remain unchanged.

Changes: E2E Devcontainer Fixtures

Layer / File(s) Summary
Add shared fixture helper
e2e/framework/util.go
WriteTempDevcontainer creates a temporary directory, creates its .devcontainer subdirectory, writes devcontainer.json, and returns the directory path.
Use shared helper in E2E tests
e2e/tests/outdated/outdated.go, e2e/tests/upgrade/upgrade.go
The outdated and upgrade tests use framework.WriteTempDevcontainer. Both files remove their local fixture-writing helper; the outdated tests also remove the helper’s path/filepath import.

Priority: ⬇️ Low

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

Change: Refactor

Merge Risk: ⚪ Minimal · up to 5227c

This change centralizes E2E fixture setup while preserving the existing fixture behavior and caller cleanup. No actionable current-head merge risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: moving the duplicated devcontainer fixture helper into shared e2e framework code.
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.
  • 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 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

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

@skevetter
skevetter marked this pull request as ready for review October 14, 2026 16:42
@mergify

mergify Bot commented Oct 14, 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 21c01dd into main Oct 14, 2026
107 checks passed
@skevetter
skevetter deleted the refactor/e2e-dedupe-devcontainer-fixture branch October 14, 2026 17:06
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