Files
orca/config/scripts/pr-e2e-pane-close-routing.test.mjs
T
ff27338299 refactor(ssh): connect fails for hosts orcad can't serve; remove the relay client path (#27214)
* wip: connect fails for hosts the managed server can't serve; remove relay session, deploy and relay UI

* wip: delete relay-only client modules left unreachable, prune their tests and gates

* wip: format

* wip: exhaustive unserved message

* wip: drop relay attestation test for the deleted ownership proof

* fix: prune stale baselines; type the test transport stub

* fix(ssh): census proves leftover relay leases; name the remedy for older terminals; translate every connect-failure surface

* test(ssh): leftover leases defer to the host census

* test(e2e): remove relay-path SSH e2e specs and their CI lanes

* test(e2e): drop the auto-convert case that built its relay era through a live relay

* test(e2e): mark relay-era browser and catalog journeys fixme until they seed a profile

* test(e2e): seed relay-era browser and catalog journeys from a saved profile

The three journeys built their old-version state through a connect without an orcad template, which now refuses the host. They now start from a seeded relay-era profile, so the first connect converts the host as an upgrading user's would.

* chore(ci): drop shard timings for the deleted relay tests

* test(e2e): carry a relay-era login cookie across the browser conversion; own every launch

* test(ci): drop the deleted SSH layout oracle from its route

* test(e2e): open the retained browser after conversion, retrying a pre-connect card

* test(e2e): bind the relay-era browser partition before seeding its cookie

A relay-era build always recorded the partition binding before a page stored
data in it. Seeding the cookie into an unbound partition made the binding store
refuse it (browser_route_partition_binding_store_invalid), so the retained tab
showed the generic routing card and Retry could never clear it.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: m4air <m4air@Mac.localdomain>
Co-authored-by: Claude <noreply@anthropic.com>
2026-10-10 22:10:33 -07:00

71 lines
3.0 KiB
JavaScript

import { describe, expect, it } from 'vitest'
import { existsSync } from 'node:fs'
import { join, resolve } from 'node:path'
import {
PR_E2E_SOURCE_ROUTES,
selectPrE2eSpecs,
shouldRunReusablePrE2e
} from './pr-e2e-source-routing.mjs'
const projectDir = resolve(import.meta.dirname, '../..')
/**
* The product paths of #21005, "retire captured remote handles when pending panes close". It
* changed the pane close and retirement lifecycle across three transports and matched no route
* at all, so it merged with E2E skipped outright. The routes named every module that BINDS a
* pane and none that unbinds one.
*/
const PENDING_PANE_CLOSE_CHANGE = [
'src/renderer/src/components/terminal-pane/retire-unbound-ipc-terminal-pane.ts',
'src/renderer/src/components/terminal-pane/retire-unbound-runtime-terminal-pane.ts',
'src/renderer/src/components/terminal-pane/terminal-pane-close-admission.ts',
'src/renderer/src/components/terminal-pane/terminal-pane-retirement-ownership.ts',
'src/renderer/src/components/terminal-pane/use-terminal-pane-close-actions.ts',
'src/renderer/src/store/terminals/terminal-tab-close-providers.ts'
]
const CLOSE_ROUTE = PR_E2E_SOURCE_ROUTES.find(
(route) => route.id === 'terminal-pane.close-and-retirement'
)
describe('pane close and retirement PR E2E routing', () => {
it('selects the close specs for a pane close lifecycle change', () => {
expect(selectPrE2eSpecs(PENDING_PANE_CLOSE_CHANGE)).toEqual([
'tests/e2e/paired-remote-split-pane-host-retired-ghost.spec.ts',
'tests/e2e/terminal-pane-close-layout-consistency.spec.ts',
'tests/e2e/terminal-parked-close-retirement.spec.ts'
])
expect(shouldRunReusablePrE2e(PENDING_PANE_CLOSE_CHANGE)).toBe(true)
})
it('routes each unbind authority on its own, not just as a group', () => {
expect(CLOSE_ROUTE, 'the close route was renamed or removed').toBeDefined()
// A single-file change is the shape that slipped through; assert per path rather than only
// on the union, where one matching path would hide five that do not.
for (const file of PENDING_PANE_CLOSE_CHANGE) {
expect(selectPrE2eSpecs([file]), file).toEqual(CLOSE_ROUTE.specs.toSorted())
}
})
it('keeps every routed spec and authority a real file', () => {
for (const spec of CLOSE_ROUTE.specs) {
expect(existsSync(join(projectDir, spec)), spec).toBe(true)
}
for (const file of PENDING_PANE_CLOSE_CHANGE) {
expect(existsSync(join(projectDir, file)), file).toBe(true)
}
})
it('leaves unrelated changes alone', () => {
// Neighbours in the same directories that this route must not claim.
for (const file of [
'src/renderer/src/components/terminal-pane/CloseTerminalDialog.tsx',
'src/renderer/src/components/terminal-pane/terminal-hidden-view-parking.ts',
'src/renderer/src/runtime/runtime-rpc-client.ts',
'src/renderer/src/store/terminals/terminal-tab-close-providers.test.ts'
]) {
expect(CLOSE_ROUTE.matches(file), file).toBe(false)
}
})
})