Files
orca/config/scripts/ci-unit-files.mjs
T
Neil 4049bc77d6 feat(orcad): gate agent launches on readiness and refuse callers that leave while waiting (#35710)
* feat(orcad): gate agent launches on accounts and cancel feature waits for departed callers

requires: may read the parsed params, so terminal.create and
session.tabs.createTerminal wait on accounts only when they start an
agent; plain shells stay ungated. createAgentSession, ensureAgentSession,
agentSession.create, agent.launch (unless it reuses a terminal),
git.generateCommitMessage and the worker-launching orchestration methods
also wait on accounts. The feature wait races the request signal and the
connection close and refuses without running the handler.

* feat(orcad): gate terminal.ensureAgentSession only for explicit launches

An attach to an existing session is restore latency and needs no fresh
account state; only kind 'explicit' may start an agent.

* test: reset orcad feature readiness after every unit test

A startOrcad test that fails partway left latches closed, so later tests
in the same worker could wait 10 s on a gated method.
2026-10-28 23:25:44 -07:00

73 lines
3.5 KiB
JavaScript

import { globSync } from 'node:fs'
import { defaultExclude } from 'vitest/config'
// Why one constant: the cross-version-wire job runs this directory, so a new file there runs with no list to update.
export const CROSS_VERSION_WIRE_DIR = 'tests/e2e/cross-version-wire/'
export const UNIT_INCLUDE = [
'src/**/*.test.ts',
'src/**/*.test.tsx',
'config/scripts/**/*.test.ts',
'config/scripts/**/*.test.mjs',
'tests/tools/**/*.test.mjs',
'tests/e2e/**/*.unit.test.ts'
]
export const UNIT_SETUP_FILES = [
'config/scripts/vitest-real-agent-home-write-guard.ts',
'config/scripts/vitest-bun-node-builtins.ts',
'config/scripts/vitest-dom-setup.ts',
'config/scripts/vitest-host-ports-setup.ts',
'config/scripts/vitest-caller-identity-env-setup.ts',
'config/scripts/vitest-orcad-feature-readiness-reset.ts'
]
export const UNIT_EXCLUDE = [
...defaultExclude,
'src/main/daemon/repro-13767-shell-ready-marker-lost-to-exec.test.ts',
'src/main/daemon/shell-ready.test.ts',
'src/main/daemon/node-pty-fd-leak.test.ts',
'src/main/providers/local-pty-shell-ready-zsh-launch-environment.test.ts',
'src/main/providers/__tests__/shell-ready-framework-example.test.ts',
'src/main/pty/omp-shell-wrapper-alias-safety.test.ts',
'src/main/pty/omp-shell-wrapper.node-pty.test.ts',
'src/main/shell-startup-feature-channel.test.ts',
'src/main/zsh-deferred-startup-line-init.live-shell.test.ts',
'src/main/terminal-history-fish-session.node-pty.test.ts',
'src/main/zsh-scoped-histfile.live-shell.test.ts',
'src/main/zsh-startup-hook-user-config-equivalence.live-shell.test.ts',
'src/main/runtime/structured-session-cli-login-shell.live-shell.test.ts',
'src/renderer/src/components/terminal-pane/fish-color-scheme-child-stdin.node-pty.test.ts',
'src/shared/fish-query-reply-child-stdin.node-pty.test.ts',
'src/shared/fish-wsl-cwd-report.node-pty.test.ts',
'src/main/wsl-sh-cwd-report.node-pty.test.ts',
'src/shared/pty-reply-echo-shapes.node-pty.test.ts',
'src/shared/startup-shell-portability.live-shell.test.ts',
'src/shared/posix-command-path-lookup.test.ts',
'tests/e2e/relay-region-compatibility.unit.test.ts',
'tests/e2e/relay-region-correction.unit.test.ts',
'src/main/browser/cookies/browser-google-cookie-clear.electron.test.ts',
// Electron probes with in-process deadlines; the package job runs them serially.
'src/main/browser/popup-origin-chrome.electron.test.ts',
'src/main/browser/browser-link-materialization.electron.test.ts',
'src/main/browser/browser-client-page-renderer-lifecycle.electron.test.ts',
'src/main/browser/browser-route-webrtc-egress.electron.test.ts',
'src/main/persistence/profile-state/profile-state-writer-stall.electron.test.ts',
'src/main/browser/browser-popup-compatibility.electron.test.ts',
'src/main/browser/browser-popup-adapter-compatibility.electron.test.ts',
'src/main/browser/browser-popup-native-compatibility.electron.test.ts',
'src/main/browser/browser-popup-background-compatibility.electron.test.ts',
'src/main/browser/extensions/browser-extension-api.electron.test.ts',
'src/main/browser/extensions/browser-extension-persistence.electron.test.ts',
'src/main/browser/extensions/browser-extension-lifecycle.electron.test.ts',
'src/main/browser/extensions/browser-extension-toolbar.electron.test.ts',
'src/main/browser/extensions/browser-extension-native-messaging.electron.test.ts',
`${CROSS_VERSION_WIRE_DIR}**`
]
export function discoverUnitFiles(root = process.cwd()) {
return globSync(UNIT_INCLUDE, { cwd: root, exclude: UNIT_EXCLUDE })
.map((file) => file.replaceAll('\\', '/'))
.sort()
}