Files
orca/config/scripts/ssh-localhost-e2e-routing.test.mjs
T
Neil 197ea3a3b3 Free PR CI capacity by avoiding repeated setup and real-time test waits (#24355)
* Reduce repeated PR setup and transcript timing waits; add hosted comparisons

* Align parallelism contract with Node-only external rebuild toolchain

* Record hosted coverage and launch package, store, and cancellation comparisons

* Apply hosted Windows setup savings and remove measured test waits

* Keep measured PR package gains and remove completed comparison jobs

* Report measured test counts with precise units
2026-10-01 11:51:43 -07:00

52 lines
2.3 KiB
JavaScript

import { DEDICATED_E2E_SPECS } from './ci-e2e-job-selection.mjs'
import { existsSync, readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { parse } from 'yaml'
import { expect, it } from 'vitest'
import { selectPrE2eSpecs } from './pr-e2e-source-routing.mjs'
const workflow = parse(
readFileSync(resolve(import.meta.dirname, '../../.github/workflows/e2e.yml'), 'utf8')
)
it('gives the localhost SSH journey its same-filesystem server and agent prerequisite', () => {
const spec = 'tests/e2e/ssh-localhost.spec.ts'
const job = workflow.jobs['ssh-localhost']
expect(job.if).toContain("inputs.test_files == ''")
expect(job.if).toContain(spec)
expect(job['runs-on']).toBe('ubuntu-latest')
expect(job.needs).toEqual(['build', 'prepare-native-cache'])
const setup = job.steps.find((step) => step.name === 'Start isolated localhost SSH server')
expect(setup.run).toContain('ListenAddress 127.0.0.1')
expect(setup.run).toContain('PasswordAuthentication no')
expect(setup.run).toContain('UsePAM yes')
expect(setup.run).toContain('mkdir -p "$HOME/.pi/agent"')
for (const key of ['ORCA_E2E_SSH_PORT', 'ORCA_E2E_SSH_USER', 'ORCA_E2E_SSH_IDENTITY_FILE']) {
expect(setup.run).toContain(key)
}
const run = job.steps.find((step) => step.name === 'Run localhost SSH terminal and hook journey')
expect(run.env.ORCA_E2E_SSH_LOCALHOST).toBe('1')
expect(run.env.ORCA_FEATURE_REMOTE_AGENT_HOOKS).toBe('1')
expect(run.run).toContain(spec)
expect(run.run).toContain('--project=electron-headless')
expect(run.run).not.toContain('--retries')
expect(run['continue-on-error']).toBeUndefined()
expect(DEDICATED_E2E_SPECS).toContain(spec)
})
it('selects the localhost journey for its remote hook authorities', () => {
const spec = 'tests/e2e/ssh-localhost.spec.ts'
for (const file of [
'src/relay/relay-agent-hook-runtime.ts',
'src/relay/agent-hook-server.ts',
'src/relay/plugin-overlay.ts',
'src/main/agent-hooks/server.ts',
'src/main/ssh/ssh-relay-session.ts',
'src/shared/agent-hook-relay.ts'
]) {
expect(existsSync(resolve(import.meta.dirname, '../..', file)), file).toBe(true)
expect(selectPrE2eSpecs([file])).toContain(spec)
}
expect(selectPrE2eSpecs(['src/renderer/src/components/Unrelated.tsx'])).not.toContain(spec)
})