Files
deepseek-harness/scripts/run-coverage-partitions.ts
Tianyi Cui 333d7e75d2 test(vitest): apply the lane test budget inside every inline project
DSH_COVERAGE_TEST_TIMEOUT_MS expanded to --testTimeout, --hookTimeout, and
--expect.poll.timeout on the coverage and serial lanes, but Vitest forwards
only a fixed list of CLI overrides into inline projects and neither
hookTimeout nor expect is on it, so under the root config's two projects the
hook and expect.poll budgets stayed at Vitest's defaults on every lane.

vitest.config.ts now reads the variable through coverageTestTimeoutOptions and
spreads the three budgets into both projects; run-gates and the partition
coordinator pass no timeout flags, leaving one owner for the rule. A new spec
spawns vitest on the root config with a 200 ms budget and proves all three
waits end inside both projects, that unset keeps the defaults, and that a
malformed value fails at config load.

Fixes #5335
Related to #5325
2026-09-28 13:37:20 +08:00

26 lines
887 B
TypeScript

/** CLI entry for partitioned Vitest coverage. */
import { resolve } from 'node:path'
import {
COVERAGE_PARTITIONS_ENV,
CoveragePartitionCoordinator,
forwardedCoverageArgs,
parseCoveragePartitionCount,
} from './coverage-partitions.ts'
const partitions = parseCoveragePartitionCount(process.env[COVERAGE_PARTITIONS_ENV])
if (partitions === undefined) {
throw new Error(`${COVERAGE_PARTITIONS_ENV} is required by partitioned coverage.`)
}
const pnpmEntrypoint = process.env.npm_execpath
if (pnpmEntrypoint === undefined || pnpmEntrypoint === '') {
throw new Error('partitioned coverage must be invoked through a pnpm package script.')
}
const coordinator = new CoveragePartitionCoordinator({
root: resolve(import.meta.dirname, '..'),
partitions,
pnpmEntrypoint,
vitestArgs: forwardedCoverageArgs(process.argv.slice(2)),
})
process.exitCode = await coordinator.run()