test: make zalo token resolver symlink test compatible with Windows#90280
test: make zalo token resolver symlink test compatible with Windows#90280aniruddhaadak80 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the Zalo token test suite to skip the “rejects symlinked token files” test based on actual symlink capability rather than a Windows-only platform check.
Changes:
- Add a runtime probe to detect whether file symlinks can be created in the current environment.
- Replace the
process.platform !== "win32"gating with a capability-based skip for the symlink-related test.
| const canCreateFileSymlinks = (() => { | ||
| const probeDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-zalo-token-probe-")); | ||
| const targetFile = path.join(probeDir, "target.txt"); | ||
| const linkFile = path.join(probeDir, "link.txt"); | ||
| try { | ||
| fs.writeFileSync(targetFile, "target", "utf8"); | ||
| fs.symlinkSync(targetFile, linkFile, "file"); | ||
| return true; | ||
| } catch { | ||
| return false; | ||
| } finally { | ||
| fs.rmSync(probeDir, { recursive: true, force: true }); | ||
| } | ||
| })(); |
| }); | ||
|
|
||
| it.runIf(process.platform !== "win32")("rejects symlinked token files", () => { | ||
| it.skipIf(!canCreateFileSymlinks)("rejects symlinked token files", () => { |
|
Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 1:55 PM ET / 17:55 UTC. Summary PR surface: Tests +15. Total +15 across 1 file. Reproducibility: yes. Source inspection shows current main still gates the Zalo symlink-token assertion on process.platform rather than file-symlink capability, and the PR body includes Windows terminal proof for the changed test behavior. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this narrow Zalo-only test portability fix after maintainer review, unless maintainers first repair #95531 and intentionally use that combined branch instead. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main still gates the Zalo symlink-token assertion on process.platform rather than file-symlink capability, and the PR body includes Windows terminal proof for the changed test behavior. Is this the best way to solve the issue? Yes for the narrow Zalo-only cleanup. The combined replacement could be cleaner if repaired, but it is currently conflicting with a failed check, so this PR remains a maintainable path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b580258e94e0. Label changesLabel justifications:
Evidence reviewedPR surface: Tests +15. Total +15 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
2d52325 to
83700d2
Compare
83700d2 to
fb0de09
Compare
|
Rebased onto main. Ready for re-review. |
|
Closing as superseded by the merged combined symlink-test fix in #95531 (merge commit c0ee7a1). That PR carries the same Zalo capability-gated test behavior and also includes the related QQBot cleanup, so keeping this separate branch open would duplicate the landed path. Thanks for the original fix direction here. |
Replaces the hardcoded Windows skip in the Zalo token resolver test suite with a dynamic
canCreateFileSymlinkscapability check. If file symlinking is supported by the OS environment, the test executes. Otherwise, it skips gracefully, allowing correct platform-specific testing.Verified Windows Proof
The following test execution log shows the test run on Windows. Since file symlink creation is not permitted on this host, the symlinked token file rejection test was skipped gracefully as expected (1 skipped, 5 passed), rather than failing the whole suite: