import type { NormalizedConfig } from './types.js'; import { PlannedTestSuite } from '../types.js'; /** * Represents a discrete chunk of tests assigned to a specific browser page slot. * A chunk contains a subset of the total test files, grouped by their originating * suites to maintain suite-specific configurations like timeout and retries. */ export interface TestChunk { /** * The unique identifier for this chunk (e.g., "chromium-t100-0"). */ id: string; /** * The name of the browser environment this chunk runs in (e.g., "chromium", "firefox"). */ browserName: string; /** * The index of the parallel Playwright page executing this chunk. */ pageIndex: number; /** * The priority tier this chunk belongs to. */ priority: number; /** * The list of test suites assigned to this chunk, along with their associated * configuration options and resolved file URLs. */ suites: Omit[]; } /** * Manages the partitioning (sharding) of test suites and files across multiple * browser instances and parallel pages. * * Suites are grouped into priority tiers and executed tier-by-tier in descending * priority order. Within each tier the workload is distributed round-robin across * concurrency slots, exactly as before. */ export declare class TestPoolManager { #private; private config; browserNames: string[]; private suites; /** * Creates a new TestPoolManager and immediately computes the workload chunks. * * @param config - The normalized configuration containing concurrency settings. * @param browserNames - An array of browser names to generate chunks for. * @param suites - The fully expanded list of test suites and their resolved file URLs. */ constructor(config: NormalizedConfig, browserNames: string[], suites: PlannedTestSuite[]); /** * Retrieves a specific test chunk by its unique identifier. * * @param chunkId - The unique ID of the chunk (e.g., "chromium-t100-0"). * @returns The corresponding TestChunk or undefined if not found. */ getChunk(chunkId: string): TestChunk | undefined; /** * Retrieves all chunk IDs assigned to a specific browser, across all priority tiers. * Used by BrowserManager during boot to create the right number of pages. * * @param browserName - The name of the browser (e.g., "chromium"). * @returns An array of chunk IDs. */ getChunkIdsForBrowser(browserName: string): string[]; /** * Returns chunk IDs for a given browser, grouped by priority tier and sorted * in descending priority order (highest first). * * Used by the Orchestrator to drive sequential wave execution. * * @param browserName - The name of the browser (e.g., "chromium"). * @returns A Map of priority → chunk ID array, iterated in descending priority order. */ getChunkIdsByTier(browserName: string): Map; /** * Finds the chunk ID that contains a given file path for the specified browser. * Falls back to the first chunk for that browser when no chunk contains the file. * * @param browserName - The name of the browser (e.g., "chromium"). * @param filePath - An absolute path or path suffix to look for. * @returns The matching chunk ID, or the default first chunk for that browser. */ getChunkIdForFile(browserName: string, filePath: string): string; /** * Returns the total number of test files across all chunks and browsers, * excluding files that belong to suites marked with `excludeFromReporting`. * * @param ignoreFileFilters - If true, returns total count ignoring active config.filters.files. * @returns Total number of reportable test files */ getFilesCount(ignoreFileFilters?: boolean): number; /** * Returns the set of file pathnames (as strings) belonging to suites marked * with `excludeFromReporting`. Used by the Cli to suppress `file:start` / * `file:end` events for those files from reaching reporters. * * Only considers the first browser's chunks to avoid duplicates. */ getExcludedFilePaths(): Set; /** * Returns the set of priority values whose chunks contain *only* suites marked * with `excludeFromReporting`. The orchestrator uses this to know which waves * should run after `runner:end` is emitted (i.e. after the reporter summary prints). */ getExcludedOnlyPriorities(): Set; }