/** * Where a Playwright run under `--shard k/n` is placed by whole files: the * reporter's `preprocess`. * * Playwright splits a shard by test groups, and under `fullyParallel` a group * is one test, so one file's tests land in several shards and each records a * part of it. Since 1.62 a reporter sees the whole collected suite before * Playwright shards it — after `--project`, `--grep` and `.only` — and may turn * Playwright's split off and exclude what is not its own. So the placement is * the one every runner's shard takes (`shardOf` in * `@variance-authority/sense/test-selection`): by the times the record holds, or * by file count when it holds none, every file whole, and stderr says which part. * * Below 1.62 Playwright would split the shard by test, and a run that asks for * one is refused by `withTestSelection`, when the configuration is evaluated and * before anything starts, whether `--shard` is on the command line or the * configuration sets `shard`. * * A file several projects run, or `repeatEach` repeats, is one file: all its * copies go to one shard. A setup or teardown project is Playwright's to run in * every shard that keeps a test depending on it, and it cannot be excluded, so * its files are not placed. A project none of whose files are this shard's is * excluded whole, so its dependencies do not run for nothing. */ import type { FullConfig, Suite, TestRun } from '@playwright/test/reporter'; import { type SuiteTimes } from '@variance-authority/sense/test-selection'; /** What `Reporter.preprocess` is handed. */ export interface Preprocess { readonly config: FullConfig; readonly suite: Suite; readonly testRun: TestRun; } /** Keep this shard's files and exclude the rest; a run that asked for no shard is left alone. */ export declare function placeWholeFiles({ config, suite, testRun }: Preprocess, root: string, times: () => Promise, say: (line: string) => void): Promise; /** A shard as Playwright numbers it, `current` from 1. */ export interface PlaywrightShard { readonly current: number; readonly total: number; } /** * Why a run asking for `shard` is refused under Playwright `version`, which * has no `preprocess` and would split the shard test by test; `undefined` when * Playwright can place it. */ export declare function shardRefusal(version: string, shard: PlaywrightShard): string | undefined; /** * The version of `@playwright/test` the project at `from` resolves: the one * running its configuration. The peer this package was installed beside answers * only when `from` resolves none. */ export declare function installedPlaywright(from: string): string; /** * The reporters a command line's `--reporter` names, split at commas as * Playwright splits them; `undefined` when it names none, and the * configuration's own reporters run. */ export declare function reporterArgument(argv: readonly string[]): readonly string[] | undefined; //# sourceMappingURL=whole-file-shard.d.ts.map