mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
* ci: share test transforms and remove six redundant checks * test: remove obsolete project copies and two build string checks * test: use the injected clock for exact launch readiness budgets * fix: retain IME confirmation and retire disconnected Windows PTYs * ci: include relay installer in existing Windows boundaries * perf: import the canonical SSH manager for filesystem operations * test: remove 42 source-spelling checks * test: advance deadlines after real entry and await actual PTY exit * Preserve native Windows exit acknowledgments and skip daemon-only smoke triggers
58 lines
1.8 KiB
JavaScript
58 lines
1.8 KiB
JavaScript
import { build } from 'esbuild'
|
|
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs'
|
|
import { tmpdir } from 'node:os'
|
|
import { join, resolve } from 'node:path'
|
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
import { smokeForeignSqliteReaderWorker } from './foreign-sqlite-reader-worker-smoke.mjs'
|
|
import { ORCAD_CHILD_ENTRY_POINTS } from './orcad-entry-build.mjs'
|
|
|
|
const ENTRY = 'foreign-sqlite-reader-entry.js'
|
|
const directories = []
|
|
let builtDirectory
|
|
|
|
function fixtureDirectory() {
|
|
const directory = mkdtempSync(join(tmpdir(), 'orca-foreign-sqlite-smoke-test-'))
|
|
directories.push(directory)
|
|
return directory
|
|
}
|
|
|
|
beforeAll(async () => {
|
|
builtDirectory = fixtureDirectory()
|
|
await build({
|
|
entryPoints: [resolve(ORCAD_CHILD_ENTRY_POINTS.foreignSqliteReader)],
|
|
outfile: join(builtDirectory, ENTRY),
|
|
bundle: true,
|
|
platform: 'node',
|
|
target: 'node18',
|
|
format: 'cjs',
|
|
external: ['electron'],
|
|
logLevel: 'silent'
|
|
})
|
|
}, 60_000)
|
|
|
|
afterAll(() => {
|
|
for (const directory of directories) {
|
|
rmSync(directory, { recursive: true, force: true })
|
|
}
|
|
})
|
|
|
|
describe('foreign SQLite reader build smoke', () => {
|
|
it('passes against the built entry', () => {
|
|
expect(() => smokeForeignSqliteReaderWorker(builtDirectory)).not.toThrow()
|
|
})
|
|
|
|
it('fails when the entry is missing', () => {
|
|
expect(() => smokeForeignSqliteReaderWorker(fixtureDirectory())).toThrow('smoke failed')
|
|
})
|
|
|
|
it('fails when the worker answers without reading', () => {
|
|
const directory = fixtureDirectory()
|
|
writeFileSync(
|
|
join(directory, ENTRY),
|
|
`const { parentPort } = require('node:worker_threads')
|
|
parentPort.on('message', ({ id }) => parentPort.postMessage({ id, ok: true, value: [] }))`
|
|
)
|
|
expect(() => smokeForeignSqliteReaderWorker(directory)).toThrow('smoke failed')
|
|
})
|
|
})
|