Files
hermes-agent/apps/desktop/electron/bootstrap-runner-git-binary.test.ts
teknium1 f4b9694da4 test: restore regression coverage #120071 dropped as dead or redundant
Review on #120071 (yoniebans) found tests deleted as 'dead' that were only
mis-gated, and regression tests with no remaining equivalent:

- Discord voice receive (real NaCl/RTP: wrong-key drop, DAVE decrypt
  failure, malformed padding, non-allowlisted speaker) moves out of the
  never-selected tests/integration/ to tests/plugins/platforms/, where no
  conftest stubs discord.py; 34 pass with the messaging extra.
- Five *_windows_live.py files had a bare skipif(win32), so
  list_os_marked_tests.py never selected them; now windows_only.
- iron-proxy token-swap E2E (opt-in gate) is back.
- Gateway regressions: cached agent iteration cap (#48127), clarify JSON
  never renders as progress (#52374), handoff watcher DB work off the event
  loop, delivery ledger single connection, checkpoint prune and memory trim
  housekeeping ticks.
- Desktop: command-screenshot IPC rejection, inactive WSL bridge never
  spawns wsl.exe, bootstrap runner git binary.
2026-09-23 10:34:54 -07:00

22 lines
921 B
TypeScript

import assert from 'node:assert/strict'
import type * as ChildProcess from 'node:child_process'
import { test, vi } from 'vitest'
const execFileSyncMock = vi.fn((..._args: unknown[]) => 'abcdef1234567890\n')
vi.mock('node:child_process', async importOriginal => ({
...(await importOriginal<typeof ChildProcess>()),
execFileSync: execFileSyncMock
}))
test('resolveCheckoutHead runs the probed git binary, not the first PATH hit (#114718)', async () => {
// The bootstrap marker pin used a bare `git`, which on the reported Mac is
// an Intel-only /usr/local/bin/git that fails at spawn, silently dropping
// the real pin. main.ts now passes the binary it already probed.
const { resolveCheckoutHead } = await import('./bootstrap-runner')
assert.equal(resolveCheckoutHead('/repo', { gitBinary: '/usr/bin/git' }), 'abcdef1234567890')
assert.equal(execFileSyncMock.mock.calls[0]?.[0], '/usr/bin/git')
})