picod: fix path test on macOS - #436
Conversation
Signed-off-by: Zhou Zihang <z@mcac.cc>
There was a problem hiding this comment.
Pull request overview
Fixes macOS-specific failures in TestSanitizePath by canonicalizing the temp workspace path (resolving /var → /private/var) before asserting sanitized results remain within the workspace. This aligns the test’s containment check with Server.sanitizePath, which compares against a symlink-resolved workspace.
Changes:
- Resolve the temporary workspace directory via
filepath.EvalSymlinks. - Use the resolved workspace path as the base for
filepath.Relcontainment assertions.
There was a problem hiding this comment.
Code Review
This pull request updates the test suite in pkg/picod/files_test.go to resolve symlinks for the temporary directory using filepath.EvalSymlinks before performing containment assertions. This ensures that tests pass consistently on platforms like macOS, where /var is a symlink to /private/var. There are no review comments provided, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #436 +/- ##
==========================================
+ Coverage 58.41% 58.47% +0.05%
==========================================
Files 36 36
Lines 3463 3463
==========================================
+ Hits 2023 2025 +2
+ Misses 1231 1230 -1
+ Partials 209 208 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RainbowMango
left a comment
There was a problem hiding this comment.
/lgtm
/approve
Thanks.
/remove-kind bug
/kind cleanup
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: RainbowMango The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Fixes
TestSanitizePathon macOS, where/varresolves to/private/var. The test now canonicalizes the temporary workspace before checking that sanitized paths remain inside it.This only corrects the test assertion; production path sanitization is unchanged.
Which issue(s) this PR fixes:
None.
Special notes for your reviewer:
This change was prepared with AI assistance and manually verified.
Environment:
Before this change:
After this change:
The production implementation is unchanged.
Does this PR introduce a user-facing change?: