/** * The process that folds what the workers recorded. * * Playwright runs specs in worker processes, and the execution index is one * file that is merged rather than appended to. The merge retires the previous * crossings of every file whose incoming row says it finished, which is right * for one process that recorded a file whole and wrong for two that each * recorded part of one: the later row wins and the earlier worker's regions * leave the index. The spec is then recorded as fully observed with half of * what it walked, and the next `--since` skips it over a line that ran. Nothing * fails; the run is green and the index quietly wrong, which is the one * direction selection may not go. * * So the workers stage and this folds. Install it beside the recording * fixtures, in the same configuration: * * ```ts * export default defineConfig({ * reporter: [['list'], ['@variance-authority/playwright-test/reporter']], * }); * ``` * * It is worth installing for a single-worker run too: a worker that finds no * staging directory merges for itself and says so, and one that does contribute * costs a file write it would have spent on the merge anyway. * * Under `--shard k/n` it also places the shard, by whole files * (`whole-file-shard.ts`), and turns Playwright's own split off. Below * Playwright 1.62 nothing calls `preprocess`, so Playwright's split runs: * `withTestSelection` refuses such a run when the configuration is evaluated, * and a configuration that names this reporter without it is not refused. */ import type { Reporter } from '@playwright/test/reporter'; import { type InstrumentMode } from '@variance-authority/sense/journal'; import { type Preprocess } from './whole-file-shard.js'; /** * Where the folded record goes. The same values the fixtures were given. * * They have to match: the workers stage crossings recorded against one root and * one build's records, and this resolves them against whatever it is told. A * mismatch is not an error anybody sees — it is a record written under paths no * later run will ask about. */ export interface ExecutionReporterOptions { /** * A directory inside the repository; defaults to the cwd. Recorded paths are * relative to the checkout it sits in, never to it. */ readonly root?: string; /** Where the coverage layers live. Defaults to the repository's cache. */ readonly cacheRoot?: string; /** The coverage index. Defaults to the repository's cache. */ readonly coverageFile?: string; /** The suite this run is, as the root `variance.config.json` declares it under `suites`. */ readonly suite?: string; /** * The probe recipe the build placed, matching `testSelectionProbes()`'s * `mode`. `presence` when absent, as it is there. * * It has to be the same answer on both sides: a snapshot names the recipe * its ordinals were cut by, and a fold that claims another one refuses every * journal the run collected. */ readonly mode?: InstrumentMode; /** * Files whose contents are preconditions of every spec this run recorded. * * A `globalSetup`, a fixture module the specs share, a seeded database * dump — nothing *enters* them, so no module row answers for them, and * without this a commit that edits one selects nothing at all. */ readonly preconditions?: readonly string[]; } /** * Fold every worker's contribution into one record, once, at the end of the run. * * Unnamed because a Playwright reporter is loaded by path and read off the * default export, so the name would be for nobody: the configuration names the * entrypoint, never the class. */ export default class implements Reporter { #private; constructor(options?: ExecutionReporterOptions); /** Reporters print nothing here; the only lines are refusals, and those go to stderr. */ printsToStdio(): boolean; /** Playwright 1.62 and newer: place a `--shard` by whole files, before Playwright would split it. */ preprocess(params: Preprocess): Promise; onBegin(): void; onEnd(): Promise; } //# sourceMappingURL=reporter.d.ts.map