Files
orca/src/main/agent-hooks/managed-hook-runtime.test.ts
T
4f81dfc128 perf(ssh): cut warm high-latency connects from 88.7s to 7.7s (#9015)
Move managed agent-hook filesystem work behind one relay RPC so high-latency SSH connects pay one WAN round trip instead of hundreds. Keep installers serial, lock shared account config across relay processes, and fence cancelled connection generations from replacement state.

Co-authored-by: nasagong <zinho2000@gachon.ac.kr>
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-07-20 12:18:57 -07:00

23 lines
766 B
TypeScript

import { afterEach, describe, expect, it, vi } from 'vitest'
import { resolveRelayGrokHome } from './managed-hook-runtime'
afterEach(() => {
vi.unstubAllEnvs()
})
describe.runIf(process.platform !== 'win32')('resolveRelayGrokHome', () => {
it('uses the login-shell GROK_HOME and normalizes trailing separators', async () => {
vi.stubEnv('SHELL', '/bin/sh')
vi.stubEnv('GROK_HOME', '/srv/grok///')
await expect(resolveRelayGrokHome('/home/orca')).resolves.toBe('/srv/grok')
})
it('falls back when the login-shell GROK_HOME is not an absolute POSIX path', async () => {
vi.stubEnv('SHELL', '/bin/sh')
vi.stubEnv('GROK_HOME', '../relative')
await expect(resolveRelayGrokHome('/home/orca')).resolves.toBe('/home/orca/.grok')
})
})