GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — fix(sandbox): gate /tmp test assertions on GOOS, not path existence by euxarist · Pull Request #426 · Twigpine/zero Conversation
|
WalkthroughTwo sandbox tests now treat ChangesSandbox test /tmp gating
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
hello @euxaristia kindly rebase to main and fix conflicts |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
TestPermissionProfileFromPolicyIncludesDefaultTempWriteRoots and
TestNewScopeNormalizesAndValidatesExtraRoots guard their /tmp assertion with
pathExists("/tmp"), intending to skip it on Windows. But Go resolves the bare
path /tmp against the current drive on Windows, so on any host where C:\tmp
exists the guard passes while the product code (correctly, by design - see
defaultTempWriteRootCandidatesForGOOS) uses %TEMP%/%TMP% instead, and both
tests fail. Gate the assertion on runtime.GOOS != "windows" as well; POSIX
behavior is unchanged.
Co-Authored-By: Claude Fable 5 <[email protected]>
e59531d to
23120e3
Compare
There was an error while loading. Please reload this page.
|
Rebased onto main. One note: main already picked up the functional guard fix via #378 while this was open, so after the rebase this PR only adds the explanatory comment for why the GOOS check is needed (Go resolves the bare path /tmp against the current drive on Windows, so a stray C:\tmp made the old pathExists guard pass). Merge it for the comment or close as superseded by #378, either is fine. Sandbox suite passes on Windows 11 after the rebase. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The functional part of this PR — the runtime.GOOS != "windows" guard on the /tmp test assertions — already landed on main via #378 (confirmed at manager_test.go:75 and scope_test.go:132). So the current diff is comment-only (+6/−0): two identical 3-line comments explaining why the guard needs the GOOS check.
The comments are accurate — I verified the claim against internal/sandbox/scope.go (defaultTempWriteRootCandidatesForGOOS returns only TEMP/TMP on Windows and adds /tmp only on POSIX), and the gotcha is real (Go resolves the bare /tmp against the current drive on Windows, so a stray C:\tmp could satisfy a naive pathExists-only guard). Given #414 broke a Windows test by simplifying something subtle, a "don't simplify this away" comment is cheap regression insurance.
That said — applying our usefulness-first bar: this is documentation churn on a superseded PR. I'd lean toward closing it as superseded to keep the history clean, but it's harmless enough that merging the comment is defensible too. You flagged this yourself (@euxaristia): "merge for the comment or close as superseded, either is fine." Your call.
CI note: the red Smoke (windows-latest) is not this PR — it's the known TestLoadOrCreateSecretConcurrentConverges concurrency flake in internal/oauth, a package this PR doesn't touch. Everything else is green.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The PR adds explanatory comments to two existing test assertions in internal/sandbox/manager_test.go and internal/sandbox/scope_test.go. No production code, test logic, or assertions are changed. The functional guard (runtime.GOOS != "windows") already landed on main via #378; this PR only documents why the guard is necessary.
go build ./... — pass (worktree)go vet ./internal/sandbox/... — passgofmt -l on changed files — cleango test ./internal/sandbox/... -count=1 — passinternal/sandbox) show ok in the log. The failure is in a post-test smoke step, not the test suite. The PR is comment-only and cannot cause a test failure. This is an environmental/pre-existing issue on the Windows runner.No linked issue. The author is a community contributor (euxaristia). Per CONTRIBUTING.md, community PRs require an approved parent issue with the issue-approved label. No such issue is linked. However, the change is comment-only with zero functional impact — the process violation is technical. Maintainer's call whether to merge or close as superseded (Vasanthdev2004 already noted the functional fix landed via #378).
None. The diff is two comment additions to test files.
All reviews are on the current head (23120e34). No stale reviews.
Comment-only PR with zero regression risk; the functional fix it documents already landed via #378, so merge for the documentation value or close as superseded.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The Windows smoke job failed on TestLoadOrCreateSecretConcurrentConverges in internal/oauth, unrelated to this change. Retriggering to confirm it was a flake.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.