mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 00:57:45 +00:00
* test: consolidate orchestration mailbox suites * test: update mailbox reliability gate paths * test: preserve mailbox reliability history
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { rmSync } from 'node:fs'
|
|
import { afterEach, describe, expect, it, vi } from 'vitest'
|
|
import {
|
|
createBoundRun,
|
|
createDatabase,
|
|
createRuntime,
|
|
driveToLiveIdle,
|
|
insertDirectRunMessage,
|
|
PTY_ID,
|
|
temporaryDirectories
|
|
} from './orchestration-mailbox-notification-test-harness'
|
|
|
|
describe('orchestration mailbox pointer CLI command', () => {
|
|
afterEach(() => {
|
|
vi.useRealTimers()
|
|
for (const directory of temporaryDirectories.splice(0)) {
|
|
rmSync(directory, { recursive: true, force: true })
|
|
}
|
|
})
|
|
|
|
it.each([
|
|
['dev WSL', { isWsl: true }, 'orca-dev'],
|
|
['SSH', { connectionId: 'ssh-target', isWsl: true }, 'orca']
|
|
])('renders the %s CLI command in a mailbox pointer', async (_name, options, command) => {
|
|
vi.useFakeTimers()
|
|
const db = createDatabase('orca-mailbox-cli-command-')
|
|
const harness = createRuntime(db, options)
|
|
const run = createBoundRun(db, 'CLI command Run')
|
|
insertDirectRunMessage(db, run.id, 'Command-aware pointer')
|
|
|
|
await driveToLiveIdle(harness.runtime)
|
|
|
|
expect(harness.write).toHaveBeenCalledWith(
|
|
PTY_ID,
|
|
expect.stringContaining(`${command} orchestration check --run ${run.id}`)
|
|
)
|
|
db.close()
|
|
})
|
|
})
|