mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 02:47:34 +00:00
test: remove low-value journal, input and capture examples
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -22,25 +22,6 @@ function shellContractsStepTests(workflowYaml) {
|
||||
return step.run.split(/\s+/).filter((token) => token.endsWith('.test.ts'))
|
||||
}
|
||||
|
||||
/** A pr.yml shaped like the real one around the shell contracts step, with `run` as the block scalar body. */
|
||||
function workflowWithShellContractsRun(run) {
|
||||
const body = run
|
||||
.split('\n')
|
||||
.map((line) => (line === '' ? '' : ` ${line}`))
|
||||
.join('\n')
|
||||
return `jobs:
|
||||
shell_contracts:
|
||||
steps:
|
||||
- name: Install fish
|
||||
run: echo fish
|
||||
- name: ${SHELL_CONTRACTS_STEP}
|
||||
run: |
|
||||
${body}
|
||||
- name: Later step
|
||||
run: pnpm exec vitest run src/later.test.ts
|
||||
`
|
||||
}
|
||||
|
||||
describe('per-job path classification', () => {
|
||||
// Mobile-only edits must run audits that lint mobile; skipped audits let #20702 duplicate imports break later merge refs.
|
||||
|
||||
@@ -96,37 +77,6 @@ describe('per-job path classification', () => {
|
||||
expect(stdout).toContain('xterm_patch_sync=true\n')
|
||||
})
|
||||
|
||||
describe('shell contracts step parsing', () => {
|
||||
it('reads every command of the step, past a blank line, and no other step', () => {
|
||||
const run = [
|
||||
'pnpm exec vitest run --maxWorkers=1 \\',
|
||||
' src/first.live-shell.test.ts \\',
|
||||
' src/second.node-pty.test.ts',
|
||||
'',
|
||||
'# A second command after a blank line is still part of the step.',
|
||||
'pnpm exec vitest run src/third.test.ts'
|
||||
].join('\n')
|
||||
expect(shellContractsStepTests(workflowWithShellContractsRun(run))).toEqual([
|
||||
'src/first.live-shell.test.ts',
|
||||
'src/second.node-pty.test.ts',
|
||||
'src/third.test.ts'
|
||||
])
|
||||
})
|
||||
|
||||
it('returns the exact list, so a dropped entry is a failure rather than a smaller count', () => {
|
||||
const files = Array.from(
|
||||
{ length: 12 },
|
||||
(_, index) => `src/shell-${index}.live-shell.test.ts`
|
||||
)
|
||||
const run = `pnpm exec vitest run --reporter=dot \\\n${files.map((file) => ` ${file} \\`).join('\n')}\n --bail=1`
|
||||
expect(shellContractsStepTests(workflowWithShellContractsRun(run))).toEqual(files)
|
||||
})
|
||||
|
||||
it('reports a missing step instead of an empty list', () => {
|
||||
expect(shellContractsStepTests('jobs:\n shell_contracts:\n steps: []\n')).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
// Unit shards exclude live-shell tests, so a test the shell contracts job runs must also route a focused
|
||||
// edit to that job; otherwise a change to it, or to what it guards, runs no real shell at all (STA-2380 C2 F1).
|
||||
it('routes every test the shell contracts job runs to shell_contracts', () => {
|
||||
@@ -144,25 +94,4 @@ describe('per-job path classification', () => {
|
||||
const unrouted = tests.filter((file) => classifyPrJobs([file]).shell_contracts !== true)
|
||||
expect(unrouted).toEqual([])
|
||||
})
|
||||
|
||||
it('routes the command-paint attribution sources to shell_contracts, and only those', () => {
|
||||
const guarded = [
|
||||
'src/main/runtime/terminal/input/terminal-command-paint.ts',
|
||||
'src/main/runtime/terminal/wait/tui-idle-evidence-source.ts',
|
||||
'src/main/runtime/terminal/wait/tui-idle-evidence.ts',
|
||||
'src/shared/draft-paste-ready-scanner.ts',
|
||||
'src/main/runtime/terminal/wait/tui-idle-zsh-preexec-hook-order.live-shell.test.ts'
|
||||
]
|
||||
for (const file of guarded) {
|
||||
expect(classifyPrJobs([file]).shell_contracts, file).toBe(true)
|
||||
}
|
||||
// Neighbours the live-shell test does not guard stay on the ordinary unit shards.
|
||||
for (const file of [
|
||||
'src/main/runtime/terminal/wait/tui-idle-hook-lane.ts',
|
||||
'src/main/runtime/terminal/input/terminal-command-paint.test.ts',
|
||||
'src/shared/draft-paste-ready-scanner.test.ts'
|
||||
]) {
|
||||
expect(classifyPrJobs([file]).shell_contracts, file).toBe(false)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@@ -26,7 +26,7 @@ vi.mock('./renderer-hang-records', () => ({
|
||||
return state.publication
|
||||
}
|
||||
}))
|
||||
import { startRendererHangCapture, reduceRendererHangStack } from './renderer-hang-capture'
|
||||
import { startRendererHangCapture } from './renderer-hang-capture'
|
||||
|
||||
const handles: { stop: () => void }[] = []
|
||||
const responses: (() => void)[] = []
|
||||
@@ -131,26 +131,6 @@ it('reconciles a dead generation before admission and an old reply cannot clear
|
||||
expect(state.records.at(-1)).toMatchObject({ windowId: 4, status: 'captured' })
|
||||
})
|
||||
|
||||
it('drops a cut input field before redaction while preserving complete frames', () => {
|
||||
const result = reduceRendererHangStack(
|
||||
`at busy (file:///private/home/app.js:7:3)\n${'at '.repeat(6000)}`
|
||||
)
|
||||
expect(result).toEqual({
|
||||
frames: [{ name: 'busy', module: 'app.js', line: 7, column: 3 }],
|
||||
status: 'captured',
|
||||
truncated: true
|
||||
})
|
||||
})
|
||||
|
||||
it('records an unanswered renderer request explicitly while retaining its physical owner', async () => {
|
||||
const blocked = window(6)
|
||||
;(await blocked.start())?.stop()
|
||||
expect(state.records.at(-1)).toMatchObject({ windowId: 6, status: 'request-pending', samples: 0 })
|
||||
const shared = window(7)
|
||||
await shared.start()
|
||||
expect(state.records.at(-1)).toMatchObject({ windowId: 7, status: 'process-capture-pending' })
|
||||
})
|
||||
|
||||
it('awaits baseline publication before requesting a stack and cannot start after cancellation during the write', async () => {
|
||||
let finishPublication: () => void = () => {}
|
||||
state.publication = new Promise<void>((resolve) => {
|
||||
|
||||
@@ -81,34 +81,6 @@ describe('tui-idle on a slow-starting Claude', () => {
|
||||
await vi.advanceTimersByTimeAsync(POLL_INTERVAL_MS * 3)
|
||||
await expect(wait).resolves.toMatchObject({ satisfied: true })
|
||||
})
|
||||
|
||||
it('does not settle on a boot banner Claude printed before its composer', async () => {
|
||||
const { runtime, handle, write } = await startClaudePane()
|
||||
write(SHELL_RUNS_CLAUDE)
|
||||
const settled = vi.fn()
|
||||
const wait = runtime.waitForTerminal(handle, { condition: 'tui-idle', timeoutMs: 60_000 })
|
||||
wait.then(settled, () => {})
|
||||
|
||||
await vi.advanceTimersByTimeAsync(POLL_INTERVAL_MS)
|
||||
write('Loading Claude Code…\r\n')
|
||||
await vi.advanceTimersByTimeAsync(POLL_INTERVAL_MS * 4)
|
||||
expect(settled).not.toHaveBeenCalled()
|
||||
|
||||
write(CLAUDE_COMPOSER_BARE_TITLE)
|
||||
await vi.advanceTimersByTimeAsync(POLL_INTERVAL_MS * 3)
|
||||
await expect(wait).resolves.toMatchObject({ satisfied: true })
|
||||
})
|
||||
|
||||
it('settles the bare-title weak lane once the composer marker has arrived and output is quiet', async () => {
|
||||
const { runtime, handle, write } = await startClaudePane()
|
||||
write(SHELL_RUNS_CLAUDE + LATER_PREEXEC_HOOK_PRINTS)
|
||||
await vi.advanceTimersByTimeAsync(POLL_INTERVAL_MS)
|
||||
write(CLAUDE_COMPOSER_BARE_TITLE)
|
||||
const wait = runtime.waitForTerminal(handle, { condition: 'tui-idle', timeoutMs: 60_000 })
|
||||
|
||||
await vi.advanceTimersByTimeAsync(POLL_INTERVAL_MS * 3)
|
||||
await expect(wait).resolves.toMatchObject({ satisfied: true })
|
||||
})
|
||||
})
|
||||
|
||||
describe('worker start on a slow-starting Claude', () => {
|
||||
|
||||
@@ -313,19 +313,6 @@ describe.skipIf(process.platform === 'win32')('tui-idle under real zsh preexec h
|
||||
}
|
||||
)
|
||||
|
||||
itWithZsh('attributes paint to Claude only once its own composer marker arrives', () => {
|
||||
const { shell, agent } = splitAtAgentStart(capture.chunks)
|
||||
const paint = new TerminalCommandPaint()
|
||||
const observe = paintObserver(paint)
|
||||
observe(shell)
|
||||
// The any-visible-byte latch is what C1 F1 found: hook text satisfies it before Claude runs.
|
||||
expect(paint.hasPainted()).toBe(hookCase.anyBytePaintBeforeAgent)
|
||||
expect(hasTerminalAgentPainted({ commandPaint: paint }, 'claude')).toBe(false)
|
||||
|
||||
observe(agent)
|
||||
expect(hasTerminalAgentPainted({ commandPaint: paint }, 'claude')).toBe(true)
|
||||
})
|
||||
|
||||
itWithZsh.each(RECHUNKINGS)(
|
||||
'attributes paint the same way with the capture %s',
|
||||
(_label, rechunk) => {
|
||||
|
||||
Reference in New Issue
Block a user