UNPKG

histoire

Version:

A fast story book powered by Vite

45 lines • 2.2 kB
import type { HistoireTestRunSummary } from '@histoire/shared'; import type { ExecutionTask } from '../../execution-types.js'; /** One captured per-story task, created (and source-fenced) before the batch is enqueued. */ export interface BatchItem { /** Exact story this task runs. */ storyId: string; /** Task from `createHistoireTestTask`; its validation and cleanup are honored. */ task: ExecutionTask<HistoireTestRunSummary>; } /** Live position of a batch; stays readable after the batch settles. */ export interface BatchProgress { /** Every story of the batch, in execution order. */ readonly storyIds: readonly string[]; /** Stories whose task finished (assertion failures included). */ readonly completed: readonly string[]; /** Story being executed now, or the one that was interrupted. */ readonly current: string | undefined; /** * Stories whose result was not produced: not yet started, interrupted, or * following an infrastructure failure. Callers carry these into a successor. */ pending: () => string[]; } /** A batch ready for one lane submission. */ export interface AffectedBatch { /** Single lane task; enqueue exactly once. */ task: ExecutionTask<HistoireTestRunSummary>; /** Position tracker, valid before, during and after execution. */ progress: BatchProgress; } /** * Builds the affected-subset task. Captured per-story tasks run sequentially * inside ONE lane submission: they are called directly and never enqueued, so * the occupied lane cannot deadlock on itself. Each task is validated before it * starts and cleaned up after it ended, on success and failure alike. An * infrastructure failure or abort stops the batch; ordinary assertion failures * stay summary data and the batch continues. * @param items Captured tasks in execution order. * @param options Extra lane-head fence (generation still active). * @param options.validate Throws when the owner is gone; checked at the head and before each story. */ export declare function createAffectedBatchTask(items: readonly BatchItem[], options?: { validate?: () => void; }): AffectedBatch; //# sourceMappingURL=batch.d.ts.map