mirror of
https://github.com/stablyai/orca.git
synced 2026-11-01 17:47:40 +00:00
* feat(checks): add optional job log outcome * fix(checks): preserve host capture lifetimes and safe outcomes * fix(checks): retrieve and retry bounded failed-job logs * test(checks): cover queued snapshots and captured error safety * test(checks): verify sanitized host excerpts and paired failures * test(checks): identify measurements and preserve paired cleanup * Use the generated check-log fixture in host retrieval tests * Keep real paired-server shutdown outside the injected stall deadline
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { githubPrCheckDetailsSchema } from './github-pr-check-reply-schema'
|
|
|
|
describe('optional job log outcome', () => {
|
|
it.each(['available', 'empty', 'error', 'not_requested'])(
|
|
'preserves %s and job metadata',
|
|
(logState) => {
|
|
const result = githubPrCheckDetailsSchema.parse({
|
|
name: 'check',
|
|
jobs: [{ id: 1, name: 'job', logTail: 'excerpt', logState, steps: [{ name: 'step' }] }]
|
|
})
|
|
expect(result?.jobs[0]).toMatchObject({
|
|
id: 1,
|
|
name: 'job',
|
|
logTail: 'excerpt',
|
|
logState,
|
|
steps: [{ name: 'step' }]
|
|
})
|
|
}
|
|
)
|
|
it.each([undefined, null, 'future', 3, {}, ['error']])(
|
|
'salvages unknown outcome %j without losing the job',
|
|
(logState) => {
|
|
const result = githubPrCheckDetailsSchema.parse({
|
|
name: 'check',
|
|
jobs: [{ id: 1, name: 'job', logTail: 'excerpt', logState }]
|
|
})
|
|
expect(result?.jobs[0]).toMatchObject({ id: 1, name: 'job', logTail: 'excerpt' })
|
|
expect(result?.jobs[0]).not.toHaveProperty('logState')
|
|
}
|
|
)
|
|
})
|