mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 09:27:29 +00:00
Prepare requested immutable historical snapshots before timed extraction and direct reads, using the existing acquisition/process helpers and local-only consumers. Move four suites' historical module setup into per-pin hooks without changing pins, compatibility assertions, workers, extraction/assertion deadlines or publication ownership. Independent reviews and the binding design settlement passed. The cold comparison and normal uninstrumented final-head CI each passed49files197tests; normal Checkout62s/job276s. All temporary probes removed; brennan-ready READY. Tracked in STA-13683. Outer-hook failure attribution limitation tracked in STA-13703. No application, saved-data or wire behavior change.
28 lines
685 B
TypeScript
28 lines
685 B
TypeScript
import { beforeAll } from 'vitest'
|
|
|
|
export function prepareReleaseFixtures<T>(
|
|
refs: readonly string[],
|
|
load: (ref: string) => Promise<T>
|
|
) {
|
|
const results = new Map<string, { value: T } | { error: unknown }>()
|
|
for (const ref of refs) {
|
|
beforeAll(async () => {
|
|
try {
|
|
results.set(ref, { value: await load(ref) })
|
|
} catch (error) {
|
|
results.set(ref, { error })
|
|
}
|
|
}, 180_000)
|
|
}
|
|
return (ref: string): T => {
|
|
const result = results.get(ref)
|
|
if (!result) {
|
|
throw new Error(`Historical release fixture was not prepared: ${ref}`)
|
|
}
|
|
if ('error' in result) {
|
|
throw result.error
|
|
}
|
|
return result.value
|
|
}
|
|
}
|