Files
moltbot/scripts/lib/vitest-local-scheduling.d.mts
Nimrod Gutman c247e36664 feat(test): use host-aware local full-suite defaults (#65264)
* feat(test): use host-aware local full-suite defaults

* fix(test): remove undefined local profile host info
2026-04-12 12:46:20 +03:00

41 lines
1.2 KiB
TypeScript

export type VitestHostInfo = {
cpuCount?: number;
loadAverage1m?: number;
totalMemoryBytes?: number;
};
export type LocalVitestScheduling = {
maxWorkers: number;
fileParallelism: boolean;
throttledBySystem: boolean;
};
export const DEFAULT_LOCAL_FULL_SUITE_PARALLELISM: number;
export const LARGE_LOCAL_FULL_SUITE_PARALLELISM: number;
export const DEFAULT_LOCAL_FULL_SUITE_VITEST_WORKERS: number;
export const LARGE_LOCAL_FULL_SUITE_VITEST_WORKERS: number;
export function isCiLikeEnv(env?: Record<string, string | undefined>): boolean;
export function detectVitestHostInfo(): Required<VitestHostInfo>;
export function resolveLocalVitestMaxWorkers(
env?: Record<string, string | undefined>,
system?: VitestHostInfo,
pool?: "forks" | "threads",
): number;
export function resolveLocalVitestScheduling(
env?: Record<string, string | undefined>,
system?: VitestHostInfo,
pool?: "forks" | "threads",
): LocalVitestScheduling;
export function shouldUseLargeLocalFullSuiteProfile(
env?: Record<string, string | undefined>,
system?: VitestHostInfo,
): boolean;
export function resolveLocalFullSuiteProfile(
env?: Record<string, string | undefined>,
system?: VitestHostInfo,
): {
shardParallelism: number;
vitestMaxWorkers: number;
};