Skip to content

test: isolate the home directory on Windows (USERPROFILE) - #50

Merged
forrestlinfeng merged 1 commit into
EvoMap:mainfrom
Ruiyi-Zhang-BUPT:fix/fresh-home-win32
Oct 23, 2026
Merged

forrestlinfeng merged 1 commit into
EvoMap:mainfrom
Ruiyi-Zhang-BUPT:fix/fresh-home-win32

Conversation

@Ruiyi-Zhang-BUPT

@Ruiyi-Zhang-BUPT Ruiyi-Zhang-BUPT commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

freshHome() isolated the home directory by setting only process.env.HOME. Windows resolves os.homedir() from USERPROFILE, so on Windows every isolated test still read the real ~/.evolver — including a stale settings.json whose Proxy URL pointed at a dead port. Tests that expected their fake Proxy instead talked to the stale endpoint and failed (17 failures), and three tests hand-rolled the same HOME-only isolation.

Fix

  • freshHome() now snapshots and sets HOME, USERPROFILE, HOMEDRIVE and HOMEPATH together (the last three only on win32), and restores or deletes each on cleanup.
  • The three hand-rolled blocks (apply.test.js x2, diagnostics.test.js x1) now go through freshHome().

Verification

Windows 11, Node v22.20.0:

before after
pass 134 151
fail 17 0
skipped 6 6

The 6 skips are the existing deliberate win32 guards on /bin/sh shims. No product code changed.

freshHome() only set HOME, but Windows resolves os.homedir() from USERPROFILE, so every isolated test still read the real ~/.evolver settings (a stale Proxy URL) and bypassed its fake Proxy. Three tests also hand-rolled the same HOME-only isolation.

Set HOME, USERPROFILE, HOMEDRIVE and HOMEPATH together and restore them all, and route the hand-rolled blocks through freshHome().

Windows: 151 pass / 0 fail / 6 skipped (was 134/17/6).
@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Sentinel 已审核此变更,未发现已核验问题,但发现需要人工确认的风险。

另有 1 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。

开发 agent 查询详情: 调用 MCP 工具 sentinel_pr_review_context,传入 owner_repo="evomap/evolver-dsh-plugin"、pr_number=50、head_sha="ea8055cb6b0b5fb81b06e91020dd490ee0f418cf",并按条目追加 finding_id 或 finding_key。

由 Sentinel 审核 · 目标提交 ea8055cb6b0b

@evomap-aiqa-bot

Copy link
Copy Markdown

Sentinel 保留了 1 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
开发 agent:请 review 以下 advisory,并逐条给出“已验证无风险 / 已修复 / 转为后续事项”的结论;不要只做整体确认。

  • [P3] reset/clear 后可能缺少 in-flight completion 防护 — 状态链探针:reset/clear path touches async state but no abort/generation fence is visible for in-flight completion...(truncated) · test/support/host.js · state_chain_212725efcdd9e5e6

需要完整证据时,可用行末 finding_key 查询 Sentinel PR review context。

由 Sentinel 审核 · 目标提交 ea8055cb6b0b

@forrestlinfeng
forrestlinfeng merged commit d5c9a43 into EvoMap:main Oct 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants