fix: mock accessSync in workdir-setup test to avoid macOS false failure#6050
Conversation
The test 'falls back to nearest existing ancestor when no ancestor fails the access check' assumed all real ancestor directories pass the W_OK|X_OK check. On macOS, /var/folders/dl fails this check, causing the test to fail because a system directory becomes the blocker instead of falling through to the nearestExisting fallback. Fix by mocking accessSync to always pass, ensuring the fallback path is reliably exercised regardless of host filesystem permissions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓 |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅ |
|
🔌 Smoke Services — All services reachable! ✅ |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
🚀 Security Guard has started processing this pull request |
|
✅ Build Test Suite completed successfully! |
|
✅ Contribution Check completed successfully! PR #6050 follows the applicable CONTRIBUTING.md guidelines based on the provided context; no review comment needed. |
|
❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed... |
|
Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded. |
|
✅ Smoke Gemini completed. All facets verified. 💎 |
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅ |
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓 |
|
✅ Smoke Claude passed |
There was a problem hiding this comment.
Pull request overview
This PR makes the ensureDirectory EACCES diagnostic test suite deterministic across platforms by removing an assumption about real filesystem permissions on ancestor directories (notably on macOS under /var/folders/...).
Changes:
- Updates the “falls back to nearest existing ancestor when no ancestor fails the access check” test to mock
fs.accessSyncas always succeeding. - Improves the inline test comment to document the macOS-specific failure mode being avoided.
Show a summary per file
| File | Description |
|---|---|
src/workdir-setup.test.ts |
Mocks fs.accessSync in one test to reliably exercise the “no ancestor fails access check” fallback path on all OSes. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Low
Smoke Test: Claude Engine Validation
Overall result: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test: Copilot PAT Auth
Overall: PASS | Auth mode: PAT (COPILOT_GITHUB_TOKEN) Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
|
PR titles:
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Smoke Test: Services Connectivity
Overall: FAIL — host.docker.internal (172.17.0.1) unreachable from sandbox. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Chroot Version Comparison Results
Overall: Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
🔬 Smoke Test Results
Overall: PASS (core connectivity verified) cc @lpcox Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
|
Smoke Test: Copilot BYOK (Direct) Mode ✅ GitHub.com connectivity (HTTP 200) Status: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
OTEL Tracing Smoke Test — PR #6050
All 5 scenarios pass. OTEL tracing integration is fully functional. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Problem
The test
ensureDirectory EACCES diagnostic › falls back to nearest existing ancestor when no ancestor fails the access checkfails on macOS because it assumes all real ancestor directories pass theW_OK|X_OKaccess check.On macOS,
/var/folders/dl(a system-managed temp directory parent) fails this check, causing theblockervariable to be set to a system directory instead of falling through to thenearestExistingfallback as the test expects.Fix
Mock
fs.accessSyncto always pass (returnundefined) in this specific test, ensuring the "no ancestor fails" fallback path is reliably exercised regardless of host filesystem permissions.This is consistent with the test's intent — it explicitly tests the fallback behavior when no ancestor fails the access check.