Files
orca/config/scripts/run-ssh-docker-fork-upstream-backfill-e2e.mjs
T
Jinwoo-H 87f922300e test(e2e): prove SSH fork upstream backfill against a real Docker relay
Drives the actual #12967 sequence end to end: a legacy repo whose
persisted `upstream` was stripped, an app relaunch, then an SSH connect
that must backfill it and render the fork badge with no settings visit.

Deterministic and offline — getRepoUpstream short-circuits on the
`upstream` git remote before it reaches `gh`, so the container's two
remotes decide the answer with no GitHub auth or network.

Verified by revert: with the fix backed out, upstream stays unresolved
for the full 90s after connect.
2026-08-10 00:28:05 -04:00

42 lines
949 B
JavaScript

import { spawnSync } from 'node:child_process'
const rawExtraArgs = process.argv.slice(2)
const extraArgs = rawExtraArgs[0] === '--' ? rawExtraArgs.slice(1) : rawExtraArgs
const pnpm = process.platform === 'win32' ? 'pnpm.cmd' : 'pnpm'
const env = {
...process.env,
ORCA_E2E_SSH_DOCKER: '1'
}
// Why: Node's CVE-2024-27980 hardening rejects .cmd spawns without shell on Windows.
const spawnOptions = {
stdio: 'inherit',
env,
shell: process.platform === 'win32'
}
const runtime = spawnSync(pnpm, ['run', 'ensure:electron-runtime'], spawnOptions)
if (runtime.status !== 0) {
process.exit(runtime.status ?? 1)
}
const result = spawnSync(
pnpm,
[
'exec',
'playwright',
'test',
'tests/e2e/ssh-docker-fork-upstream-backfill.spec.ts',
'--config',
'tests/playwright.config.ts',
'--project',
'electron-headless',
'--workers=1',
...extraArgs
],
spawnOptions
)
process.exit(result.status ?? 1)