mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 00:02:31 +00:00
test(omp): address launch environment review feedback
This commit is contained in:
@@ -161,10 +161,7 @@ export function buildPtyHostEnv(
|
||||
if (shouldPrepareOmpShadow) {
|
||||
const ompEnv = piTitlebarExtensionService.buildPtyEnv(id, preexistingOmpAgentDir, 'omp', {
|
||||
materializeDefaultHome: explicitPiAgentKind === 'omp',
|
||||
// WSL executes on the guest and must never inherit the host's
|
||||
// PI_CONFIG_DIR. Use OMP's guest-local default when the relay has
|
||||
// not supplied a guest root yet; the relay may still override the
|
||||
// resulting source directory with its materialized guest path.
|
||||
// WSL loads the host-rooted managed extension through drvfs; guest storage stays separate.
|
||||
...(opts.isWsl
|
||||
? { configDirName: '.omp' }
|
||||
: baseEnv.PI_CONFIG_DIR !== undefined
|
||||
|
||||
@@ -68,7 +68,7 @@ describe('relay OMP config root', () => {
|
||||
expect(existsSync(join(home, '.company-omp'))).toBe(false)
|
||||
})
|
||||
|
||||
it('does not read the relay process config root when the session omits it', async () => {
|
||||
it('does not fall back to process.env for the config root', async () => {
|
||||
vi.stubEnv('PI_CONFIG_DIR', '.wrong-process-root')
|
||||
expect(await resolveOmpConfigDirName({ HOME: home }, '/bin/bash')).toBeUndefined()
|
||||
})
|
||||
|
||||
@@ -56,14 +56,15 @@ exec /bin/zsh "$@"
|
||||
}
|
||||
})
|
||||
|
||||
test.skip(
|
||||
!process.env.ORCA_OMP_PROOF_BINARY || process.platform !== 'darwin',
|
||||
'Opt-in macOS OMP runtime proof'
|
||||
)
|
||||
|
||||
test('OMP launched by Orca uses login-profile data and config roots', async ({
|
||||
orcaPage,
|
||||
electronApp
|
||||
}, testInfo) => {
|
||||
test.skip(
|
||||
!process.env.ORCA_OMP_PROOF_BINARY || process.platform !== 'darwin',
|
||||
'Opt-in macOS OMP runtime proof'
|
||||
)
|
||||
await waitForSessionReady(orcaPage)
|
||||
const worktreeId = await waitForActiveWorktree(orcaPage)
|
||||
await ensureTerminalVisible(orcaPage)
|
||||
@@ -114,7 +115,9 @@ export default function (api) {
|
||||
)
|
||||
await expect(orcaPage.locator('.xterm-screen').first()).toBeVisible()
|
||||
await orcaPage.screenshot({ path: testInfo.outputPath('omp-profile-root.png') })
|
||||
expect(await readdir(join(home, 'xdg-data', 'omp'))).toContain('agent.db')
|
||||
await expect(async () => {
|
||||
expect(await readdir(join(home, 'xdg-data', 'omp'))).toContain('agent.db')
|
||||
}).toPass({ timeout: 30_000 })
|
||||
const overrideData = join(home, 'pane-data')
|
||||
await mkdir(join(overrideData, 'omp'), { recursive: true })
|
||||
const overrideResult = testInfo.outputPath('omp-pane-paths.json')
|
||||
@@ -164,7 +167,9 @@ export default function (api) {
|
||||
session: expect.stringContaining(join('pane-data', 'omp', 'sessions'))
|
||||
})
|
||||
)
|
||||
expect(await readdir(join(overrideData, 'omp'))).toContain('agent.db')
|
||||
await expect(async () => {
|
||||
expect(await readdir(join(overrideData, 'omp'))).toContain('agent.db')
|
||||
}).toPass({ timeout: 30_000 })
|
||||
} finally {
|
||||
await orcaPage.evaluate((id) => window.api.pty.kill(id), overridePty)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user