mirror of
https://github.com/stablyai/orca.git
synced 2026-10-20 00:03:45 +00:00
test(remote): assert raw host terminal identities
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import type { Page } from '@stablyai/playwright-test'
|
||||
import type { RuntimeTerminalRead } from '../../../src/shared/runtime-types'
|
||||
import { TERMINAL_PAIRED_PARKING_RUNTIME_CAPABILITY } from '../../../src/shared/protocol-version'
|
||||
import { toWebTerminalSurfaceTabId } from '../../../src/shared/terminal-surface-id'
|
||||
import {
|
||||
toHostSessionTabId,
|
||||
toWebTerminalSurfaceTabId
|
||||
} from '../../../src/shared/terminal-surface-id'
|
||||
import {
|
||||
readPairedRetentionSample,
|
||||
startRendererLagProbe
|
||||
@@ -16,11 +19,6 @@ const MAX_RETAINED_CELL_FRACTION = 0.45
|
||||
const MAX_EVICTION_LAG_MS = 500
|
||||
const MAX_HEAP_GROWTH_BYTES = 16 * 1024 * 1024
|
||||
|
||||
type PairedTerminalParkingSeed = {
|
||||
fallbackWorktreeId: string
|
||||
repoId: string
|
||||
}
|
||||
|
||||
type RemoteTab = {
|
||||
marker: string
|
||||
originalPtyId: string
|
||||
@@ -44,7 +42,7 @@ async function callRuntime<TResult>(page: Page, method: string, params: unknown)
|
||||
|
||||
export async function runPairedTerminalParkingOracle(
|
||||
page: Page,
|
||||
seed: PairedTerminalParkingSeed,
|
||||
seed: { fallbackWorktreeId: string; repoId: string },
|
||||
options: { hostPage?: Page } = {}
|
||||
): Promise<void> {
|
||||
const fixture = createPairedTerminalParkingFixture()
|
||||
@@ -302,7 +300,7 @@ async function expectHostTerminalsUnmounted(
|
||||
activeWorktreeId: window.__store?.getState().activeWorktreeId,
|
||||
mountedCount: tabIds.filter((tabId) => window.__paneManagers?.has(tabId)).length
|
||||
}),
|
||||
remoteTabs.map(({ tabId }) => tabId)
|
||||
remoteTabs.map(({ tabId }) => toHostSessionTabId(tabId))
|
||||
),
|
||||
{ timeout: 30_000 }
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ test('ordinary-parks paired terminals and restores authoritative host scrollback
|
||||
if (!active) {
|
||||
throw new Error('Paired retention host has no active seeded worktree')
|
||||
}
|
||||
return { repoId: active.repoId, worktreeIds: worktrees.map((worktree) => worktree.id) }
|
||||
return { activeWorktreeId: active.id, repoId: active.repoId }
|
||||
})
|
||||
const offer = await createRuntimeDesktopPairingOffer(orcaPage)
|
||||
const client = await launchPairedWebClient(electronApp, offer, {
|
||||
@@ -27,7 +27,7 @@ test('ordinary-parks paired terminals and restores authoritative host scrollback
|
||||
await runPairedTerminalParkingOracle(
|
||||
client.page,
|
||||
{
|
||||
fallbackWorktreeId: seed.worktreeIds[0]!,
|
||||
fallbackWorktreeId: seed.activeWorktreeId,
|
||||
repoId: seed.repoId
|
||||
},
|
||||
{ hostPage: orcaPage }
|
||||
|
||||
Reference in New Issue
Block a user