Repository navigation
refactor(e2e): share devcontainer fixture helper - #1484
Conversation
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.
✅ Deploy Preview for devsydev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
✅ Deploy Preview for images-devsy-sh canceled.
|
|
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. |
What changed
framework.WriteTempDevcontainer(prefix, content string) stringine2e/framework/util.go. It callsos.MkdirTemp("", prefix),MkdirAll(<tmp>/.devcontainer, 0o750), andWriteFile(<tmp>/.devcontainer/devcontainer.json, content, 0o600), withExpectNoErroron each step, and returns the temp dir.writeDevcontainerJSONfrome2e/tests/outdated/outdated.goande2e/tests/upgrade/upgrade.go. The two copies were identical except for the MkdirTemp prefix.outdated-test-*(3 call sites in outdated),upgrade-test-*(5 call sites in upgrade). Prefixes are unchanged.path/filepathimport fromoutdated.go.upgrade.gostill usesfilepathandosinreadDevcontainerJSON.e2e/tests/configapply(itswriteDevcontainerJSON(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 -lon 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.gofiles, 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://lspreferences forWriteTempDevcontainer: 9 hits (1 definition, 8 call sites: outdated 3, upgrade 5). No name clash in packageframework.7635B0B1F6CAD3B372E60A9550176882C873AF3D). Commit ran prek hooks;--no-verifywas 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, reviewede2e/framework/util.go,e2e/tests/outdated/outdated.go,e2e/tests/upgrade/upgrade.go. No findings skipped.Summary by CodeRabbit