mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 00:57:45 +00:00
* [comment audit] Align legacy failure-read counts with cached display * [comment audit] Condense shared provider lifecycle and browser recovery comments [skip ci] * [comment audit] Condense shared generation, path and preview comments [skip ci] * [comment audit] Condense host, file and Git contract rationale [skip ci] * [comment audit] Tighten Git lifecycle and provider contract comments [skip ci] * [comment audit] Clarify shared host authority and launch isolation [skip ci] * [comment audit] simplify local access mobile and native chat contracts [skip ci] * [comment audit] simplify native chat presentation and state contracts [skip ci] * [comment audit] simplify native runtime and provider contracts [skip ci] * [comment audit] simplify migration and orchestration contracts [skip ci] * [comment audit] simplify plugin trust and process capture rationale [skip ci] * [comment audit] simplify terminal delivery and remote compatibility rationale [skip ci] * [comment audit] clarify remote recovery and launch wire rationale [skip ci] * [comment audit] shorten shared RPC compatibility and runtime evidence comments [skip ci] * [comment audit] simplify secure storage shell startup and sidebar rationale [skip ci] * [comment audit] clarify sidebar, skill and SSH invariants [skip ci] * [comment audit] condense structured chat delivery and timing rationale [skip ci] * [comment audit] condense terminal replay and telemetry invariants [skip ci] * [comment audit] clarify launch permission and terminal delivery rationale [skip ci] * [comment audit] clarify workspace ownership and layout contracts [skip ci] * [comment audit] wait for fitted and painted SSH terminal links * [comment audit] clarify layout persistence and session ownership [skip ci] * [comment audit] clarify host routing and workspace lifecycle contracts [skip ci] * [comment audit] clarify startup persistence and app lifetime comments [skip ci] * [comment audit] clarify recovery and activity boundaries [skip ci] * [comment audit] condense activity and artifact invariants [skip ci] * [comment audit] condense automation authority contracts [skip ci] * [comment audit] simplify automation scheduling and history contracts [skip ci] * [comment audit] clarify browser chrome and annotation lifecycles [skip ci] * [comment audit] clarify browser routing and retained guest ownership [skip ci] * [comment audit] clarify browser recovery and document ownership comments [skip ci] * [comment audit] restore hosted runners required by native IME fixtures * [comment audit] shorten preview, palette and dashboard invariants [skip ci] * [comment audit] clarify terminal preview, dashboard and retention comments [skip ci] * [comment audit] clarify diff-note recovery and editor lifecycle comments [skip ci] * [comment audit] shorten rich-text and combined-diff ownership comments [skip ci] * [comment audit] shorten autosave, draft recovery and model ownership comments [skip ci] * [comment audit] shorten save-queue, notebook and Markdown constraints [skip ci] * [comment audit] shorten Monaco, PDF and rich Markdown safeguards [skip ci] * [comment audit] clarify rich Markdown source and selection safeguards [skip ci] * [comment audit] clarify editor loading and emulator stream lifetimes [skip ci] * [comment audit] trim emulator and feature tour narration [skip ci] * [comment audit] clarify floating workspace and GitHub cache ownership [skip ci] * [comment audit] trim provider controls and Linear filter explanations [skip ci] * [comment audit] clarify pairing and chat resume lifetimes [skip ci] * [comment audit] clarify chat delivery and transcript lifetimes [skip ci] * [comment audit] clarify session options and host-owned status [skip ci] * [comment audit] clarify draft durability and live-status precedence [skip ci] * [comment audit] Trim chat send and model ownership explanations [skip ci] * [comment audit] Shorten transcript ownership and send recovery comments [skip ci] * [comment audit] Simplify native chat composer and transcript hook comments [skip ci] * [comment audit] Shorten native chat scroll and structured session explanations [skip ci] * [comment audit] Trim workspace picker and onboarding commentary [skip ci] * [comment audit] Simplify pet rendering, review cache and quick open comments [skip ci] * [comment audit] Trim sidebar and session history explanations [skip ci] * [comment audit] Condense session resume and review checks comments [skip ci] * [comment audit] Shorten checks state and file explorer refresh comments [skip ci] * [comment audit] Trim plugin bridge and source-control action rationale [skip ci] * [comment audit] Trim source-control listing and review rationale [skip ci] * [comment audit] Shorten sidebar lifecycle and explorer safeguards [skip ci] * [comment audit] Condense Settings account and appearance rationale [skip ci] * [comment audit] Trim pairing and repository Settings explanations [skip ci] * [comment audit] Condense Settings search SSH and terminal safeguards [skip ci] * [comment audit] Shorten Settings voice and provider ownership comments [skip ci] * [comment audit] Condense Settings draft persistence and host-state rationale [skip ci] * [comment audit] Trim Settings hooks and sidebar setup rationale [skip ci] * [comment audit] Condense sidebar deletion and board-filter safeguards [skip ci] * [comment audit] Condense worktree cards, host ownership and Markdown contracts [skip ci] * [comment audit] Condense sidebar drag, folder and filtering contracts [skip ci] * [comment audit] Condense sidebar parity, sleep and host ownership contracts [skip ci] * [comment audit] Prune focus-read baseline after comment cleanup * [comment audit] Clarify sidebar visibility, board drops and agent evidence [skip ci] * [comment audit] Tighten sidebar listing, drag and reveal contracts [skip ci] * [comment audit] Clarify viewport geometry and skill update safeguards [skip ci] * [comment audit] Tighten skill inventory, usage and host status comments [skip ci] * [comment audit] Clarify usage ownership and resource kill safeguards [skip ci] * [comment audit] Tighten tab selection, rename and search contracts [skip ci] * [comment audit] Tighten tab-strip geometry and drag ownership comments [skip ci] * [comment audit] Tighten Tasks recovery, pagination and mutation comments [skip ci] * [comment audit] Tighten provider loading and terminal recovery comments [skip ci] * [comment audit] Tighten completion, cadence and PTY ownership comments [skip ci] * [comment audit] Clarify terminal restore and parked-pane boundaries [skip ci] * [comment audit] Tighten PTY startup and replay explanations [skip ci] * [comment audit] Clarify PTY identity and delivery ownership [skip ci] * [comment audit] Shorten remote reconnect and input replay rationale [skip ci] * [comment audit] Condense terminal parking clipboard and file link comments [skip ci] * [comment audit] Clarify IME ownership and trim trace history [skip ci] * [comment audit] Shorten pane recovery and parked watcher explanations [skip ci] * [comment audit] Condense snapshot replay and visibility recovery rationale [skip ci] * [comment audit] Shorten terminal parking and keyboard ownership rationale [skip ci] * [comment audit] Trim renderer lifecycle and menu rationale [skip ci] * [comment audit] Condense workspace cleanup ownership and settlement notes [skip ci] * [comment audit] Clarify renderer hook evidence and source ownership [skip ci] * [comment audit] Tighten IPC ownership and reconnect explanations [skip ci] * [comment audit] Trim renderer focus, paste and attention comments [skip ci] * [comment audit] Shorten scroll, locale and agent lifecycle comments [skip ci] * [comment audit] Trim agent launch, resume and ownership commentary [skip ci] * [comment audit] Shorten account, browser and editor comments [skip ci] * [comment audit] Clarify host-mirror waits, previews and input ownership [skip ci] * [comment audit] Condense launch recovery and editor tokenization comments [skip ci] * [comment audit] Condense workspace selection and terminal pane rationale [skip ci] * [comment audit] Condense terminal fitting and rendering recovery comments [skip ci] * [comment audit] Condense terminal input and host routing explanations [skip ci] * [comment audit] Condense ownership and sleeping-session recovery rationale [skip ci] * [comment audit] Condense structured launch and terminal link explanations [skip ci] * [comment audit] Condense terminal ownership and workspace file routing rationale [skip ci] * [comment audit] Condense session persistence and workspace activation rationale [skip ci] * [comment audit] Condense workspace routing and browser ownership rationale [skip ci] * [comment audit] Condense mirror recovery and layout authority rationale [skip ci] * [comment audit] Condense runtime transport and file safety rationale [skip ci] * [comment audit] Condense runtime graph and structured session rationale [skip ci] * [comment audit] Condense browser creation and remote tab recovery rationale [skip ci] * [comment audit] Condense snapshot authority and publisher recovery rationale [skip ci] * [comment audit] Condense frame, startup and provider cache rationale [skip ci] * [comment audit] Condense host twin and agent lifecycle rationale [skip ci] * [comment audit] Condense browser authority and editor cleanup rationale [skip ci] * [comment audit] Condense editor buffer identity and review cache rationale [skip ci] * [comment audit] Condense provider lifetime and repository ownership rationale [skip ci] * [comment audit] Condense reconnect, hydration and terminal retirement rationale [skip ci] * [comment audit] Condense recovery, reconciliation and persistence rationale [skip ci] * [comment audit] Condense cleanup ownership and listing admission rationale [skip ci] * [comment audit] Condense teardown ordering and terminal ownership rationale [skip ci] * [comment audit] Condense recovery ledger and web host-boundary rationale [skip ci] * [comment audit] Condense web reconnect and credential lifecycle rationale [skip ci] * [comment audit] Condense cloud rollout and assignment safety rationale [skip ci] * [comment audit] Condense relay session and database recovery rationale [skip ci] * [comment audit] Condense relay placement and protocol compatibility rationale [skip ci] * [comment audit] Condense build and packaging constraints [skip ci] * [comment audit] Condense CI gates and validation isolation rationale [skip ci] * [comment audit] Condense catalog identity and browser validation rationale [skip ci] * [comment audit] Condense mobile browser and frame-budget rationale [skip ci] * [comment audit] Shorten mobile route and browser test explanations [skip ci] * [comment audit] Condense editor and session seam test rationale [skip ci] * [comment audit] Trim session and terminal closure history [skip ci] * [comment audit] Shorten terminal browser and census explanations [skip ci] * [comment audit] Preserve root-only E2E diagnostic baseline * [comment audit] Condense mobile seam and HTML preview test rationale [skip ci] * [comment audit] Condense preview instrumentation and render harness rationale [skip ci] * [comment audit] Condense bundle contracts and native-build constraints [skip ci] * [comment audit] Shorten native packaging and CI routing rationale [skip ci] * [comment audit] Condense release tooling and benchmark constraints [skip ci] * [comment audit] Condense packaging and platform gate rationale [skip ci] * [comment audit] Shorten mobile route and history rationale [skip ci] * [comment audit] Condense mobile browser and component rationale [skip ci] * [comment audit] Shorten drawer and workspace-form rationale [skip ci] * [comment audit] Trim mobile review and editor-document explanations [skip ci] * [comment audit] Condense editor lifecycle and Markdown explanations [skip ci] * [comment audit] Trim mobile file, diagnostics and dictation commentary [skip ci] * [comment audit] Simplify mobile host-list and workspace-view explanations [skip ci] * [comment audit] Clarify mobile shell lifetime and bridge delivery constraints [skip ci] * [comment audit] Condense bridge stream, native request and audio rationale [skip ci] * [comment audit] Reduce bridge schema and page-client commentary [skip ci] * [comment audit] Tighten mobile page bridge contracts [skip ci] * [comment audit] Clarify mobile cache and session constraints [skip ci] * [comment audit] Condense mobile route and lifecycle rationale [skip ci] * [comment audit] Tighten mobile shell hook timing rationale [skip ci] * [comment audit] Clarify route handoff and notification compatibility [skip ci] * [comment audit] Clarify push registration and dictation cleanup constraints [skip ci] * [comment audit] Condense keyboard geometry and native media ownership rationale [skip ci] * [comment audit] Tighten mobile chat scroll and composer concurrency rationale [skip ci] * [comment audit] Condense mobile reply compatibility and upload ownership rationale [skip ci] * [comment audit] Condense optimistic echo and scroll ownership rationale [skip ci] * [comment audit] Tighten stream replay and queued session ownership rationale [skip ci] * [comment audit] Condense mobile composer and reply-schema constraints [skip ci] * [comment audit] Clarify mobile transcript recovery and session ownership [skip ci] * [comment audit] Clarify mobile queue and source-control compatibility [skip ci] * [comment audit] Condense storage and task launch constraints [skip ci] * [comment audit] Clarify task schemas and terminal document ownership [skip ci] * [comment audit] Tighten terminal input and viewport rationale [skip ci] * [comment audit] Shorten terminal and RPC recorder contracts [skip ci] * [comment audit] Condense recorder engine and connection contracts [skip ci] * [comment audit] Shorten host credential and relay recovery comments [skip ci] * [comment audit] Tighten pairing recovery and bundle transport rationale [skip ci] * [comment audit] Clarify RPC delivery and workspace catalog boundaries [skip ci] * [comment audit] Condense catalog and relay entry contracts [skip ci] * [comment audit] Shorten shutdown and SSH relay delivery contracts [skip ci] * [comment audit] Condense WSL relay and E2E regression rationale [skip ci] * [comment audit] Shorten cross-version harness and renderer fixture explanations [skip ci] * [comment audit] Condense paired-host and E2E lifecycle rationale [skip ci] * [comment audit] Shorten layout oracle and regression explanations [skip ci] * [comment audit] Condense paired recovery and ownership regression contracts [skip ci] * [comment audit] Shorten restart, sidebar and SSH lifecycle contracts [skip ci] * [comment audit] Condense terminal rendering and IME regression rationale [skip ci] * [comment audit] Shorten terminal recovery and benchmark contracts [skip ci] * [comment audit] Condense tooling and Windows lifecycle proof rationale [skip ci] * [comment audit] Condense workflow routing and release rationale [skip ci] * [comment audit] Condense mobile security and installer contracts [skip ci] * [comment audit] Shorten native rationale and stylesheet workarounds [skip ci] * [comment audit] Shorten Windows visibility probe rationale [skip ci] * [comment audit] Condense embedded release and signing rationale [skip ci] * [comment audit] Retain current main test behavior in final reconciliation [skip ci] * [comment audit] Complete final comment review across current source inventory * [comment audit] Handle consolidated audit reports before final CI * [comment audit] Preserve credential storage census detail [skip ci] * [comment audit] Scale broad changed E2E selections with verified timing shards * [comment audit] Align E2E assertions with browser close and settled session metadata * [comment audit] Match existing E2Es to current resource and windowing contracts * [comment audit] Observe the shared server outage notice in reconnect coverage * [comment audit] Make existing renderer probes measure settled tab and PTY work * [comment audit] Align palette E2E selector with task search * [comment audit] Refresh remaining palette search selectors * [comment audit] Keep selector correction within selected audit specs * [comment audit] Await emoji fixture settings inside renderer evaluation * [comment audit] Cancel fixture fit retries between terminal tests --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
318 lines
13 KiB
JavaScript
318 lines
13 KiB
JavaScript
import { readFileSync } from 'node:fs'
|
|
import { expect, it } from 'vitest'
|
|
import { parse } from 'yaml'
|
|
import { runProcess } from '@orca/process-host'
|
|
import {
|
|
classifyE2eJobs,
|
|
DEDICATED_E2E_SPECS,
|
|
generalE2eShards,
|
|
MANAGED_SSH_E2E_SPEC_PREFIX,
|
|
NATIVE_IME_E2E_SPEC,
|
|
NODE_NETWORK_E2E_SPEC,
|
|
selectGeneralE2eSpecs
|
|
} from './ci-e2e-job-selection.mjs'
|
|
import { selectPrE2eSpecs } from './pr-e2e-source-routing.mjs'
|
|
|
|
it.each([
|
|
'src/main/runtime/runtime-browser-commands-factory.ts',
|
|
'src/main/runtime/orca-runtime-get-status.ts',
|
|
'src/main/orcad/orcad-browser-startup.ts',
|
|
'src/main/runtime/browser/browser-client-page-opening.ts'
|
|
])('routes the managed browser capability oracle from %s', (path) => {
|
|
expect(selectPrE2eSpecs([path])).toContain('tests/e2e/ssh-orcad-browser-capabilities.spec.ts')
|
|
})
|
|
|
|
it.each(['errors', 'status', 'lifecycle', 'restart-attempt'])(
|
|
'routes the real browser service status check from %s changes',
|
|
(name) => {
|
|
expect(
|
|
selectPrE2eSpecs([
|
|
`src/renderer/src/components/browser-pane/stream-remote/remote-browser-stream-${name}.ts`
|
|
])
|
|
).toContain('tests/e2e/ssh-orcad-browser-service-status.spec.ts')
|
|
}
|
|
)
|
|
|
|
it.each([
|
|
'src/renderer/src/lib/ssh-workspace-browser-route-eligibility.ts',
|
|
'src/renderer/src/components/browser-pane/use-ssh-workspace-browser-route.ts',
|
|
'src/main/browser/local-ssh-browser-route.ts',
|
|
'src/renderer/src/store/repos/converted-ssh-browser-pages.ts',
|
|
'src/renderer/src/store/slices/browser/browser-tab-actions.ts',
|
|
'src/renderer/src/hooks/ipc-events/ssh-managed-server-state-effects.ts'
|
|
])('routes the managed browser routing oracle from %s', (path) => {
|
|
expect(selectPrE2eSpecs([path])).toContain('tests/e2e/ssh-orcad-browser-routing.spec.ts')
|
|
})
|
|
|
|
it.each([
|
|
'src/renderer/src/lib/workspace-browser-tab-open.ts',
|
|
'src/renderer/src/lib/http-link-destinations.ts',
|
|
'src/renderer/src/components/terminal-pane/terminal-http-link-source-owner.ts'
|
|
])('routes the managed terminal link oracle from %s', (path) => {
|
|
expect(selectPrE2eSpecs([path])).toContain('tests/e2e/ssh-orcad-terminal-browser-link.spec.ts')
|
|
})
|
|
|
|
it.each([
|
|
'src/shared/desktop-browser-bridge-protocol.ts',
|
|
'src/main/runtime/desktop-browser-bridge/desktop-browser-bridge-route.ts',
|
|
'src/main/browser/desktop-browser-bridge/desktop-browser-bridge-executor.ts',
|
|
'src/main/ipc/desktop-browser-bridge-wiring.ts',
|
|
'src/main/runtime/rpc/methods/desktop-browser-bridge.ts'
|
|
])('routes the managed desktop browser bridge oracle from %s', (path) => {
|
|
expect(selectPrE2eSpecs([path])).toContain('tests/e2e/ssh-orcad-desktop-browser-bridge.spec.ts')
|
|
})
|
|
|
|
const workflow = parse(readFileSync('.github/workflows/e2e.yml', 'utf8'))
|
|
const prWorkflow = parse(readFileSync('.github/workflows/pr.yml', 'utf8'))
|
|
const classify = (specs) => classifyE2eJobs(JSON.stringify(specs))
|
|
|
|
it('scales broad general selections without charging extra VMs for duplicate or dedicated specs', () => {
|
|
const specs = Array.from({ length: 51 }, (_, index) => `tests/e2e/example-${index}.spec.ts`)
|
|
expect(generalE2eShards(JSON.stringify(specs.slice(0, 25)))).toEqual(['1/1'])
|
|
expect(generalE2eShards(JSON.stringify([...specs, ...specs, ...DEDICATED_E2E_SPECS]))).toEqual([
|
|
'1/3',
|
|
'2/3',
|
|
'3/3'
|
|
])
|
|
expect(generalE2eShards(JSON.stringify(['tests/e2e/ssh-orcad-example.spec.ts']))).toEqual(['1/1'])
|
|
expect(generalE2eShards('')).toEqual(['1/1'])
|
|
expect(generalE2eShards('[]')).toEqual(['1/1'])
|
|
expect(
|
|
generalE2eShards(JSON.stringify(Array.from({ length: 400 }, (_, i) => `${i}.spec.ts`)))
|
|
).toHaveLength(14)
|
|
for (const invalid of ['malformed', 'null', '{}', '[null]', '[""]']) {
|
|
expect(() => generalE2eShards(invalid)).toThrow()
|
|
}
|
|
})
|
|
|
|
function expectManagedSshLane(spec) {
|
|
expect(classify([spec])).toEqual({ e2e_run_changed: false, e2e_needs_build: true })
|
|
expect(spec.startsWith(MANAGED_SSH_E2E_SPEC_PREFIX)).toBe(true)
|
|
const lane = workflow.jobs['orcad-ssh-docker']
|
|
expect(lane.if).toContain(`contains(inputs.test_files, '${MANAGED_SSH_E2E_SPEC_PREFIX}')`)
|
|
expect(
|
|
lane.steps.some(
|
|
(step) =>
|
|
step.run?.includes('selection.selectManagedSshE2eSpecs') &&
|
|
step.env?.ORCA_E2E_SSH_DOCKER === '1'
|
|
)
|
|
).toBe(true)
|
|
}
|
|
|
|
it('runs real browser file-drop ownership in the template-building Docker job', () => {
|
|
const spec = 'tests/e2e/ssh-orcad-browser-drop-owner.spec.ts'
|
|
expectManagedSshLane(spec)
|
|
for (const source of [
|
|
'src/renderer/src/lib/file-preview.ts',
|
|
'src/renderer/src/lib/workspace-file-drag.ts',
|
|
'src/renderer/src/components/browser-pane/navigate/use-browser-page-navigation-downloads.ts',
|
|
'src/renderer/src/components/right-sidebar/FileExplorerRow.tsx',
|
|
'tests/e2e/helpers/browser-split-guest-probes.ts'
|
|
]) {
|
|
expect(selectPrE2eSpecs([source]), source).toContain(spec)
|
|
}
|
|
})
|
|
|
|
it('skips the general consumer only when every requested spec has a dedicated owner', () => {
|
|
for (const spec of DEDICATED_E2E_SPECS) {
|
|
expect(classify([spec]).e2e_run_changed, spec).toBe(false)
|
|
}
|
|
expect(classify(DEDICATED_E2E_SPECS).e2e_run_changed).toBe(false)
|
|
const future = 'tests/e2e/future-unclassified.spec.ts'
|
|
expect(classify([future])).toEqual({
|
|
e2e_run_changed: true,
|
|
e2e_needs_build: true
|
|
})
|
|
expect(selectGeneralE2eSpecs([...DEDICATED_E2E_SPECS, future])).toEqual([future])
|
|
expect(classify([...DEDICATED_E2E_SPECS, future]).e2e_run_changed).toBe(true)
|
|
})
|
|
|
|
it('keeps Electron build and native prerequisites for every consumer requiring them', () => {
|
|
for (const spec of [NODE_NETWORK_E2E_SPEC, NATIVE_IME_E2E_SPEC]) {
|
|
expect(classify([spec]), spec).toEqual({
|
|
e2e_run_changed: false,
|
|
e2e_needs_build: false
|
|
})
|
|
}
|
|
expect(workflow.jobs['ssh-browser-network-route'].needs).toBeUndefined()
|
|
for (const name of ['e2e', 'changed-e2e']) {
|
|
expect(workflow.jobs[name].needs, name).toEqual(['build'])
|
|
}
|
|
})
|
|
|
|
it('retains allocations when selection evidence is incomplete', () => {
|
|
for (const input of ['', '[]', 'null', '{}', '[null]', '[""]', 'malformed']) {
|
|
expect(classifyE2eJobs(input), input).toEqual({
|
|
e2e_run_changed: true,
|
|
e2e_needs_build: true
|
|
})
|
|
}
|
|
})
|
|
|
|
it('preserves the requested specs across source-routed and mixed selections', () => {
|
|
for (const files of [
|
|
['src/main/browser/ssh-browser-network-execution-route.ts'],
|
|
['src/shared/terminal-unicode-provider.ts'],
|
|
[NODE_NETWORK_E2E_SPEC, 'tests/e2e/future-unclassified.spec.ts']
|
|
]) {
|
|
const specs = selectPrE2eSpecs(files)
|
|
expect(specs.length).toBeGreaterThan(0)
|
|
const general = selectGeneralE2eSpecs(specs)
|
|
const dedicated = specs.filter((spec) => DEDICATED_E2E_SPECS.includes(spec))
|
|
expect([...general, ...dedicated].sort(), files.join(', ')).toEqual(specs)
|
|
expect(new Set([...general, ...dedicated]).size).toBe(specs.length)
|
|
}
|
|
})
|
|
|
|
it('applies allocation hints only to PRs and retains other callers and full references', () => {
|
|
for (const name of ['run_changed_e2e', 'needs_build']) {
|
|
expect(workflow.on.workflow_call.inputs[name]).toMatchObject({
|
|
type: 'boolean',
|
|
required: false,
|
|
default: true
|
|
})
|
|
}
|
|
expect(workflow.jobs.build.if).toBe(
|
|
"inputs.test_files == '' || github.event_name != 'pull_request' || inputs.needs_build"
|
|
)
|
|
expect(workflow.jobs.e2e.if).toBe("inputs.test_files == ''")
|
|
const changed = workflow.jobs['changed-e2e']
|
|
expect(changed.if).toContain("github.event_name != 'pull_request' || inputs.run_changed_e2e")
|
|
const command = changed.steps.find((step) => step.name === 'Run changed E2E specs').run
|
|
expect(command).toContain('node config/scripts/ci-e2e-job-selection.mjs >')
|
|
expect(command).not.toContain('mapfile -t TEST_FILES < <(')
|
|
const fallback = [...command.matchAll(/\. != "([^"]+)"/g)].map((match) => match[1])
|
|
expect(fallback).toEqual(DEDICATED_E2E_SPECS)
|
|
expect(command).toContain(`(startswith("${MANAGED_SSH_E2E_SPEC_PREFIX}") | not)`)
|
|
})
|
|
|
|
it('publishes conservative hints for malformed evidence and refuses a malformed consumer list', async () => {
|
|
const program = 'config/scripts/ci-e2e-job-selection.mjs'
|
|
const consumer = await runProcess({
|
|
program: process.execPath,
|
|
args: [program],
|
|
input: 'malformed',
|
|
timeoutMs: 10000
|
|
})
|
|
expect(consumer.code).not.toBe(0)
|
|
const hints = await runProcess({
|
|
program: process.execPath,
|
|
args: [program, '--job-outputs'],
|
|
input: 'malformed',
|
|
timeoutMs: 10000
|
|
})
|
|
expect(hints.code, hints.stderr).toBe(0)
|
|
expect(hints.stdout).toBe(
|
|
'e2e_run_changed=true\ne2e_needs_build=true\ne2e_ssh_shards=["1/2","2/2"]\n'
|
|
)
|
|
})
|
|
|
|
it('classifies PR consumers in the existing detector and passes conservative allocation hints', () => {
|
|
const detector = prWorkflow.jobs.code_paths
|
|
expect(detector.steps[0].with['sparse-checkout']).toContain(
|
|
'/config/scripts/ci-e2e-job-selection.mjs'
|
|
)
|
|
for (const name of ['e2e_run_changed', 'e2e_needs_build']) {
|
|
expect(detector.outputs[name]).toBe(`\${{ steps.e2e_filter.outputs.${name} }}`)
|
|
}
|
|
const command = detector.steps.find((step) => step.id === 'e2e_filter').run
|
|
expect(command).toContain('ci-e2e-job-selection.mjs --job-outputs >> "$GITHUB_OUTPUT"')
|
|
expect(prWorkflow.jobs.e2e.with.run_changed_e2e).toBe(
|
|
"${{ needs.code_paths.outputs.e2e_run_changed != 'false' }}"
|
|
)
|
|
expect(prWorkflow.jobs.e2e.with.needs_build).toBe(
|
|
"${{ needs.code_paths.outputs.e2e_needs_build != 'false' }}"
|
|
)
|
|
})
|
|
|
|
it.each([
|
|
'src/renderer/src/runtime/web-session-tabs-sync/mirrored-editor-file-identity.ts',
|
|
'src/renderer/src/runtime/web-session-tabs-sync/tab-builders.ts',
|
|
'src/renderer/src/runtime/web-session-tabs-sync/apply-preparation-browser.ts',
|
|
'src/renderer/src/runtime/web-session-existing-tab-index.ts'
|
|
])('routes %s to the template-building editor ownership lane', (file) => {
|
|
const spec = 'tests/e2e/ssh-orcad-editor-ownership.spec.ts'
|
|
expect(selectPrE2eSpecs([file])).toContain(spec)
|
|
expectManagedSshLane(spec)
|
|
})
|
|
|
|
const MARKDOWN_CONVERSION_SPEC = 'tests/e2e/ssh-orcad-markdown-conversion.spec.ts'
|
|
const MARKDOWN_LINK_REFRESH_SPEC = 'tests/e2e/ssh-orcad-markdown-link-refresh.spec.ts'
|
|
const MARKDOWN_LIVE_DOCUMENTS_SPEC = 'tests/e2e/ssh-orcad-markdown-live-documents.spec.ts'
|
|
|
|
it.each([
|
|
['src/renderer/src/components/editor/useMarkdownDocuments.ts', MARKDOWN_CONVERSION_SPEC],
|
|
[
|
|
'src/renderer/src/components/editor/restored-editor-workspace-runtime-owner.ts',
|
|
MARKDOWN_CONVERSION_SPEC
|
|
],
|
|
[
|
|
'src/renderer/src/components/editor/migrate-restored-editor-file-owner.ts',
|
|
MARKDOWN_CONVERSION_SPEC
|
|
],
|
|
['src/renderer/src/components/editor/rich-markdown-doc-link.ts', MARKDOWN_LINK_REFRESH_SPEC],
|
|
[
|
|
'src/renderer/src/components/editor/useRichMarkdownProgrammaticSync.ts',
|
|
MARKDOWN_LINK_REFRESH_SPEC
|
|
],
|
|
['src/renderer/src/components/editor/useMarkdownDocuments.ts', MARKDOWN_LIVE_DOCUMENTS_SPEC],
|
|
[
|
|
'src/renderer/src/components/editor/use-markdown-document-watch-refresh.ts',
|
|
MARKDOWN_LIVE_DOCUMENTS_SPEC
|
|
],
|
|
[
|
|
'src/renderer/src/components/editor/markdown-document-list-request.ts',
|
|
MARKDOWN_LIVE_DOCUMENTS_SPEC
|
|
]
|
|
])('routes %s to the template-building Markdown lane %s', (file, spec) => {
|
|
expect(selectPrE2eSpecs([file])).toContain(spec)
|
|
expectManagedSshLane(spec)
|
|
})
|
|
|
|
it.each([
|
|
'src/renderer/src/hooks/useEditorExternalWatch.ts',
|
|
'src/renderer/src/hooks/editor-runtime-file-watch.ts'
|
|
])('routes %s to the template-building editor watch recovery lane', (file) => {
|
|
const spec = 'tests/e2e/ssh-orcad-editor-watch-recovery.spec.ts'
|
|
expect(selectPrE2eSpecs([file])).toContain(spec)
|
|
expectManagedSshLane(spec)
|
|
})
|
|
|
|
it.each([
|
|
'src/renderer/src/components/right-sidebar/useFileExplorerWatch.ts',
|
|
'src/renderer/src/hooks/worktree-file-change-event.ts'
|
|
])('routes %s to the template-building explorer watch recovery lane', (file) => {
|
|
const spec = 'tests/e2e/ssh-orcad-explorer-watch-recovery.spec.ts'
|
|
expect(selectPrE2eSpecs([file])).toContain(spec)
|
|
expectManagedSshLane(spec)
|
|
})
|
|
|
|
it.each([
|
|
'src/renderer/src/components/right-sidebar/useFileExplorerWatch.ts',
|
|
'src/renderer/src/components/right-sidebar/file-explorer-operation-owner.ts',
|
|
'src/renderer/src/components/right-sidebar/FileExplorer.tsx',
|
|
'src/renderer/src/hooks/editor-external-watch-targets.ts',
|
|
'src/renderer/src/components/right-sidebar/useFileExplorerTree.ts',
|
|
'src/renderer/src/components/right-sidebar/use-file-explorer-tree-load-effects.ts'
|
|
])('routes %s to the template-building selected-host explorer lane', (file) => {
|
|
const spec = 'tests/e2e/ssh-orcad-explorer-selected-host.spec.ts'
|
|
expect(selectPrE2eSpecs([file])).toContain(spec)
|
|
expectManagedSshLane(spec)
|
|
})
|
|
|
|
it('runs managed terminal root ownership in the Docker conversion lane', () => {
|
|
const spec = 'tests/e2e/ssh-orcad-terminal-root-owner.spec.ts'
|
|
expectManagedSshLane(spec)
|
|
for (const source of [
|
|
'src/renderer/src/components/terminal-pane/terminal-worktree-path-link.ts',
|
|
'src/renderer/src/components/terminal-pane/terminal-file-open-routing.ts',
|
|
'src/renderer/src/components/terminal-pane/terminal-file-link-actions.ts',
|
|
'src/renderer/src/components/terminal-pane/terminal-file-link-hit-testing.ts',
|
|
'src/renderer/src/components/terminal-pane/terminal-link-handlers.ts',
|
|
'src/renderer/src/lib/worktree-owner-route.ts',
|
|
'tests/e2e/helpers/terminal-workspace-root-link.ts'
|
|
]) {
|
|
expect(selectPrE2eSpecs([source]), source).toContain(spec)
|
|
}
|
|
})
|