import { type DeployTarget } from '@quenty/nevermore-deploy'; import { type JobContext } from '../../job-context/job-context.js'; import { type DeployOverrides } from '../../build/build.js'; import { type ParsedTestCounts } from '../test-log-parser.js'; export interface SingleTestResult { success: boolean; logs: string; testCounts?: ParsedTestCounts; /** * Inner script execution time, forwarded from the JobContext when it can * measure pcall duration directly (aggregated batch mode). Undefined for * non-aggregated cloud/local runs — callers should fall back to wall-clock. */ durationMs?: number; /** Why the run failed, when the runner can say more than "it failed". */ error?: string; /** * Where `testCounts` came from. `returned` means the run handed them over as a * value; `scraped` means they were read out of log text, which is the channel * truncation destroys. Absent when there are no counts at all. */ countsSource?: 'returned' | 'scraped'; /** True when the verdict rests on returned results with no log to read. */ logsLost?: boolean; } /** * Combine failure reasons from the job context with those read from the logs. * * In batch mode the context has already evaluated these same logs, so the two * sources overlap. Merging on the individual reason keeps the overlap from * reading as double the failures. */ export declare function mergeFailureReasons(contextError: string | undefined, logReasons: string[]): string[]; export interface SingleTestOptions { packagePath: string; packageName: string; /** * Resolved test place. Callers fan multi-place targets out before reaching * here (see flattenToBatchTargets) — the runner never picks places[0] itself. */ target: DeployTarget; /** CLI flags that replace the target's universeId, placeId, or scriptTemplate. */ overrides?: DeployOverrides; timeoutMs?: number; /** Luau code to execute directly, bypassing the configured scriptTemplate. */ scriptText?: string; /** * Skip this run's counts-provenance line, because the caller reports it for * every package at once. Set by an aggregated batch, where one fetch serves * the whole run and the per-package line says the same thing each time. */ suppressCountsProvenance?: boolean; } /** * Build, deploy, and run a test for a single package using the provided * JobContext. The context determines the execution environment (cloud or local). * * Creates and releases its own deployment handle — the caller owns the context lifetime. */ export declare function runSingleTestAsync(context: JobContext, options: SingleTestOptions): Promise; /** * Whether this package ships a jest.config, i.e. whether it has specs to run. * * Deliberately a bounded walk, not a recursive glob: every package under `src/` * has a symlinked, self-referential `node_modules`, so recursive search here * hangs. Two levels covers the layouts in use (`src/jest.config.lua` for a * package, `src/modules/jest.config.lua` for a game) without needing a list of * them. */ export declare function packageHasJestConfigAsync(packagePath: string): Promise; /** * Read a test script from the deploy target's configured script path. */ export declare function readTestScriptAsync(packagePath: string, scriptPath: string | undefined): Promise; //# sourceMappingURL=test-runner.d.ts.map