Repository navigation
test: use junctions or skips for the remaining symlink fixtures - #2480
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 40 minutes. View limit details
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. |
There was a problem hiding this comment.
🔍 Devin Review: 6 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
|
|
||
| // The two recent siblings keep the stale-looking link inside the removable range, so only the symlink check protects it. | ||
| it.skipIf(process.platform === "win32")("never follows or removes a symlink out of the root", async () => { | ||
| it.skipIf(!symlinksSupported)("never follows or removes a symlink out of the root", async () => { |
There was a problem hiding this comment.
Windows junction coverage stays skipped
symlinksSupported probes file symlinks, but this test now creates a directory junction through createTestDirectoryLink. On Windows without Developer Mode or elevated privileges, the probe returns false even though the junction can be created. The directory safety check therefore remains skipped on those hosts. Remove the file-symlink guard from this fixture.
| it.skipIf(!symlinksSupported)("never follows or removes a symlink out of the root", async () => { | |
| it("never follows or removes a symlink out of the root", async () => { |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/ade-cli/src/services/runtime/compileCachePrune.test.ts
Line: 42
Comment:
**Windows junction coverage stays skipped**
`symlinksSupported` probes file symlinks, but this test now creates a directory junction through `createTestDirectoryLink`. On Windows without Developer Mode or elevated privileges, the probe returns false even though the junction can be created. The directory safety check therefore remains skipped on those hosts. Remove the file-symlink guard from this fixture.
```suggestion
it("never follows or removes a symlink out of the root", async () => {
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 87a74cc. Configure here.
| platform: process.platform, | ||
| chordCooldownMs: 0, | ||
| }); | ||
| helper.updateSettings({ enabled: true }); |
There was a problem hiding this comment.
Capture helper tests fail on Linux due to platform
High Severity
deliverCaptured passes platform: process.platform to CaptureHelper, which causes CaptureHelper.start() to bail out on Linux because isCaptureGestureSupported("linux") returns false. Both tests calling deliverCaptured then never spawn the mocked helper or receive stdout events, causing their assertions on onFailure and onShot to fail on Linux hosts.
Reviewed by Cursor Bugbot for commit 87a74cc. Configure here.
| fs.writeFileSync(path.join(outside, "keep.txt"), "keep"); | ||
| fs.utimesSync(path.join(outside, "keep.txt"), old, old); | ||
| fs.symlinkSync(outside, path.join(root, OLD), "dir"); | ||
| createTestDirectoryLink(outside, path.join(root, OLD)); |
There was a problem hiding this comment.
Junction test still skipped when file symlinks unsupported
Medium Severity
compileCachePrune.test.ts switches its fixture to createTestDirectoryLink (a Windows junction) but guards the test with it.skipIf(!symlinksSupported). Because symlinksSupported probes file symlink creation, the test is still skipped on non-elevated Windows hosts without Developer Mode, contrary to the intent of running the junction fixture on Windows.
Reviewed by Cursor Bugbot for commit 87a74cc. Configure here.
87a74cc to
d986f85
Compare
Follow-up to #2475 for the Windows sweep. `createTestDirectoryLink` builds a directory link as a junction on Windows (no privilege needed) and a normal directory symlink elsewhere; its link type comes from `path.sep` because some tests simulate another OS by spying on `process.platform`. Every directory-link fixture now uses it. File symlinks still cannot be created on a non-elevated Windows host, so those fixtures stay real on capable hosts and are guarded with `it.skipIf(!symlinksSupported)`. Where the test also asserted things that need no link, the non-link assertions were split into an unguarded test (or kept before the guard) so they still run here. EPERM catch-and-continue in registry and remoteMcpTools became explicit skips. Fixtures fixed: - diskFullIncident: symlink farm (file and directory links) - adeActions/registry: chat-image link; artifact-store escape - automationPlannerService / automationService: cwd escape links - captureHelper: capture-directory file link; late-capture linked directory - adeCliService: packaged agent-skills link - computerUseArtifactBrokerService: artifact-store file link; symlinked import - agentChatServiceHistory / agentChatServiceLifecycle: transcript links - piSession: authorized-store escape link - iosDeviceHub / iosSimulatorService: build-root links - projectIconResolver: linked icon directory - agentSkillRuntimeService: catalog alias and mirror-parent links - cursorAgentSkillShim: nested skill link - legacySkillCleanupService: recorded symbolic link - storageInsightsService: cleanup link and linked parent - syncHostService: artifact-store file link - ade-cli compileCachePrune: junction link, capability skip instead of a win32 skip - ade-cli remoteMcpTools: proof-folder links Co-Authored-By: Claude Code <noreply@anthropic.com>
The refactor sent the capture test through a fresh helper with `platform: process.platform`, which changed the delivery path on Linux CI and stopped `onShot`/`onFailure` from firing. Restore the original test body and guard only the file-symlink case; the late-capture directory link still uses a junction on Windows. Co-Authored-By: Claude Code <noreply@anthropic.com>
d986f85 to
07f8950
Compare


Why
On a non-elevated Windows host without Developer Mode,
fs.symlinkSyncto a file throwsEPERM; directory links work when created as junctions. PR #2475 fixed the first eight fixtures; the rest still failed before their first assertion. This is test infrastructure only — no product behavior changes.What changed
createTestDirectoryLink(target, link)to both test helpers: a junction on Windows and a directory symlink elsewhere. It chooses bypath.sep, notprocess.platform, because one suite spiesprocess.platformtodarwin.it.skipIf(!symlinksSupported): chat transcript links, registry chat-image/artifact links, computer-use artifact store, cursor skill shim, sync artifact link, remote MCP proof links.syncHostService(it skips only the file-link request and still runs the rest).compileCachePrunenow runs its junction fixture on Windows instead of skipping the whole platform.captureHelperuses a local probe because it mocksnode:fs, so the shared probe would report false everywhere.No assertion was deleted or weakened.
Evidence
cloudLaneBackupcase.ade-clitypechecks pass.Not checked
The unrelated Windows failures were left alone: CRLF assertions, POSIX process-group kills, POSIX-only
mkfifo/chmod, and tests that mockprocess.platformto Darwin while running on Windows. They predate this change and are out of scope for a symlink sweep.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; the remaining junction-coverage gap is non-blocking.Fix with agent prompt
Summary
This PR makes link-based test fixtures work on more Windows hosts without changing product code.
Reviews (3) · Last reviewed commit: "test: keep the capture-jail test's origi..." · Reviewed by Greptile