|
@@ -481,6 +481,9 @@ function lintGate(options: { needs?: string[] } = {}): Gate {
|
|
|
// small share. A budget of 1 gives each gate 1 worker; lanes that need a
|
|
// small share. A budget of 1 gives each gate 1 worker; lanes that need a
|
|
|
// strict total of one (the serial reference jobs) also set
|
|
// strict total of one (the serial reference jobs) also set
|
|
|
// DSH_GATE_CONCURRENCY=1, which keeps the gates from overlapping at all.
|
|
// DSH_GATE_CONCURRENCY=1, which keeps the gates from overlapping at all.
|
|
|
|
|
+// DSH_COVERAGE_TEST_TIMEOUT_MS raises Vitest's per-test and expect.poll
|
|
|
|
|
+// defaults together for instrumented lanes whose scheduling overhead exceeds
|
|
|
|
|
+// those defaults. Explicit fixture timeouts remain authoritative.
|
|
|
function coverageWorkerArgs(): { instrumented: string[]; exempt: string[] } {
|
|
function coverageWorkerArgs(): { instrumented: string[]; exempt: string[] } {
|
|
|
const [flag] = positiveIntArg('DSH_COVERAGE_MAX_WORKERS', '--maxWorkers')
|
|
const [flag] = positiveIntArg('DSH_COVERAGE_MAX_WORKERS', '--maxWorkers')
|
|
|
if (flag === undefined) return { instrumented: [], exempt: [] }
|
|
if (flag === undefined) return { instrumented: [], exempt: [] }
|
|
@@ -493,14 +496,23 @@ function coverageWorkerArgs(): { instrumented: string[]; exempt: string[] } {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function coverageTimeoutArgs(): string[] {
|
|
|
|
|
+ return [
|
|
|
|
|
+ ...positiveIntArg('DSH_COVERAGE_TEST_TIMEOUT_MS', '--testTimeout'),
|
|
|
|
|
+ ...positiveIntArg('DSH_COVERAGE_TEST_TIMEOUT_MS', '--expect.poll.timeout'),
|
|
|
|
|
+ ]
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
function coverageGates(): Gate[] {
|
|
function coverageGates(): Gate[] {
|
|
|
const workers = coverageWorkerArgs()
|
|
const workers = coverageWorkerArgs()
|
|
|
|
|
+ const timeouts = coverageTimeoutArgs()
|
|
|
return [
|
|
return [
|
|
|
pnpmExec('coverage', [
|
|
pnpmExec('coverage', [
|
|
|
'vitest',
|
|
'vitest',
|
|
|
'run',
|
|
'run',
|
|
|
'--coverage',
|
|
'--coverage',
|
|
|
...workers.instrumented,
|
|
...workers.instrumented,
|
|
|
|
|
+ ...timeouts,
|
|
|
], {
|
|
], {
|
|
|
label: 'test:coverage',
|
|
label: 'test:coverage',
|
|
|
env: { [COVERAGE_EXEMPT_ENV]: '1' },
|
|
env: { [COVERAGE_EXEMPT_ENV]: '1' },
|
|
@@ -510,6 +522,7 @@ function coverageGates(): Gate[] {
|
|
|
'run',
|
|
'run',
|
|
|
...coverageExemptHeavySuites.map(suite => suite.filter),
|
|
...coverageExemptHeavySuites.map(suite => suite.filter),
|
|
|
...workers.exempt,
|
|
...workers.exempt,
|
|
|
|
|
+ ...timeouts,
|
|
|
], {
|
|
], {
|
|
|
label: 'test:coverage-exempt-heavy',
|
|
label: 'test:coverage-exempt-heavy',
|
|
|
}),
|
|
}),
|