Review on #3830 pointed out that the helper's tests replaced methods on
the shared fs and console objects, which AGENTS.md rules out, and that
the recording arrays were mutated with push.
trySymlink now takes an optional deps argument in the shape
collectResources already uses, `(deps.symlinkSync || fs.symlinkSync)`,
so the refusal branches can be driven without touching anything shared.
The 13 existing call sites pass at most three arguments and are
unchanged. The recorders rebuild their arrays rather than appending.
Also adds a case that omits deps entirely, so the default dependency is
still covered rather than only the injected one.
Re-verified by mutation: emptying UNSUPPORTED_CODES, returning true
unconditionally, removing the rethrow, dropping the skip notice, and
ignoring the injected stand-in each fail 2 to 4 of the 8 cases.
Review on #3830 noted that the helper had no focused tests: a host that
permits symlinks only ever exercises the success branch, so nothing
proved the skip path this PR adds actually works.
Drives fs.symlinkSync with a stand-in to cover success and argument
forwarding, each of the three supported refusal codes, an unrelated
error, and an error with no code at all.
Verified by mutation rather than by a green run: emptying
UNSUPPORTED_CODES, returning true unconditionally, removing the rethrow,
and dropping the skip notice each fail 2 to 3 of the 7 cases.
Adds a trySymlink helper that logs the existing skip notice and returns
false on EPERM/EACCES/ENOSYS, and uses it where tests created symlinks
unguarded. Non-admin Windows accounts without Developer Mode now skip
these cases instead of failing.
- windows-test-env.js gains resolvePython: it probes each candidate with
`-c "import sys; sys.exit(0 if sys.version_info[0] == 3 else 1)"`, so the
Store stub is rejected.
- hermes-hooks.test.js launches its four hook spawns through the resolved
interpreter, falling back to python3 when none is found so a machine
without Python still fails loudly instead of skipping.
hermes-hooks goes from 0/14 to 14/14 on Windows 11; the other users of the
helper are unchanged. Product code is untouched: Hermes runs these hooks
itself and the installer writes no interpreter.
On a Windows machine with Claude Code installed natively, Git for Windows,
and the ECC plugin installed, `node tests/run-all.js` on main fails 44 tests
in 7 files. Linux CI never sees them. Three of the four causes are test
isolation gaps, fixed here (43 tests):
- claude-plugin-setup, claude-scope-migration, setup (38): fixtures put a
fake claude.cmd first on PATH, but on Windows spawning a bare `claude`
resolves only .com/.exe, so a native ~/.local/bin/claude.exe ran instead
of the fake. Fixture PATHs now drop entries holding claude.exe/claude.com.
- ecc-universal-bin, eval-harness-package (4): tar received an absolute
C:\ archive path, which Git Bash's GNU tar reads as a host:path remote
spec ("Cannot connect to C: resolve failed"). Extract from inside the
destination with a relative, forward-slash archive name, which both GNU
tar and bsdtar accept.
- harness-audit (1): the cache-layout test overrode HOME only, while
findPluginInstall also reads USERPROFILE and os.homedir(), so the real
installed plugin won over the fixture. Override USERPROFILE too.
The two helpers live in tests/lib/helpers/windows-test-env.js with a
platform-independent test, so Linux CI holds both invariants too.
The 44th failure, plugin-hook-bootstrap's no-bash test, is a production
bug rather than a test leak: System32\bash.exe launches an installed WSL
distro, which passes the bash probe. It gets a separate fix.
Preserve the original contributor histories and apply the exact independently reviewed repair.
Source-Parent: 5785183108
Review-Manifest-SHA256: e223d98c24e357715527b786257901d2ef0bebadb75ac61e5c000fe60da10f9a
Preserve contributor history and current-main behavior while resolving the exact reviewed follow-up.
Source-PR: https://github.com/affaan-m/ECC/pull/3008
Source-Parent: c492920468
Review-Manifest-SHA256: 4f71a8f8d4d3aedcfb03f41d37274c28c6b83b39250d2f466e7f8243325ae09a
Preserve contributor history and current-main behavior while resolving the exact reviewed follow-up.
Source-PR: https://github.com/affaan-m/ECC/pull/3008
Source-Parent: d0dc1fcb08
Review-Manifest-SHA256: 8f15febd33dfa9f9ac6e70cb41f75ffee7aca47dd21782e841c33d4874341d6e
Address CodeRabbit review on #2311: dedupe the local test(name, fn)
harness and route all reporter output through a shared helper
(tests/lib/helpers/mini-test-runner.js) instead of direct console.log.