Repository navigation
[PR] test(update): pin describeInstallLocation fixture to a resolved tmpdir path (#2068) - #2069
ranxianglei wants to merge 1 commit into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2110-pr.2069.f65853aThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2069.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 PR #2069 Review — 可合并 ✅ 结论先行:test-only 单文件修复(+4/−1),已本地 A/B 复现并验证、typecheck 干净、CI 全绿。方向正确、无回归、无行为变更、无新配置。建议合并(按规范由人工执行合并)。 七问:
我实际跑过的证据(Linux 上用符号链接目录指
base/diff:单提交,自当前 master 切出(merge-base == origin/master tip 无需补 commit、无需立新 issue。请人工合并:#2069 |
|
关闭:同一修复已经 #2086 合并落地(tmpdir symlink in describeInstallLocation fixture)。本 PR diff 对 master 的存在性检查 = 1.0(逐行命中),纯冗余。(孤儿 PR 扫描) |
What
tests/update-install-dir.test.ts— thedescribeInstallLocationcase failed deterministically on macOS: the fixture is built undermkdtempSync(path.join(tmpdir(), ...)), and on macOStmpdir()(/var/folders/...) is itself a symlink to/private/var/folders/.... The implementation resolves the target withrealpathSyncand emitsreal=whenever resolved ≠ given — so the "plain, not-a-symlink" fixture case reportedreal=…andassert.doesNotMatch(plain, /real=/)(line 131) failed. The test exercises package-symlink detection but was confounded by an OS-level tmpdir symlink — the §7.2 "environmental luck" class (#360).Fix
One-line test change:
const base = realpathSync(mkdtempSync(path.join(tmpdir(), "bc-installdir-")))in the affected test, so the given path and its resolved form are identical on every platform. A comment pins why the wrapper exists so it doesn't get "simplified" back. No production code touched.Scope check: the other 6 tests in the file compare literal paths against each other (
findPackageRootnever realpaths), so they are unaffected by a symlinked tmpdir — verified by running the whole file under both conditions.Verification
Reproduced the exact failure signature on Linux by pointing
TMPDIRat a symlinked directory (the same condition macOS creates natively):not ok - describeInstallLocation … expected to not match /real=/withtarget=<via-symlink> real=<resolved>TMPDIRand under plainTMPDIRnpm run typecheckcleanFull suite/build left to CI (test-only change).
Behavior changes
None. Test-only; no config surface, no wire, no defaults.
Closes #2068