



























@@ -25,6 +25,7 @@ import {
2525buildFullSuiteVitestRunPlans,
2626createVitestRunSpecs,
2727findUnmatchedExplicitTestTargets,
28+formatFailedShardDigest,
2829listFullExtensionVitestProjectConfigs,
2930orderFullSuiteSpecsForParallelRun,
3031parseTestProjectsArgs,
@@ -152,6 +153,7 @@ function isFullExtensionsProjectRun(specs) {
152153async function runVitestSpecsParallel(specs, concurrency) {
153154let nextIndex = 0;
154155let exitCode = 0;
156+const failures = [];
155157const timings = [];
156158157159const runWorker = async () => {
@@ -168,6 +170,14 @@ async function runVitestSpecsParallel(specs, concurrency) {
168170}
169171if (result.code !== 0) {
170172exitCode = exitCode || result.code;
173+failures.push({
174+code: result.code,
175+config: spec.config,
176+includePatterns: spec.includePatterns,
177+noOutputTimedOut: result.noOutputTimedOut,
178+order: index,
179+signal: result.signal,
180+});
171181}
172182if (result.timing) {
173183timings.push(result.timing);
@@ -176,7 +186,7 @@ async function runVitestSpecsParallel(specs, concurrency) {
176186};
177187178188await Promise.all(Array.from({ length: concurrency }, () => runWorker()));
179-return { exitCode, timings };
189+return { exitCode, failures, timings };
180190}
181191182192async function main() {
@@ -188,7 +198,9 @@ async function main() {
188198if (unmatchedExplicitTargets.length > 0) {
189199for (const unmatched of unmatchedExplicitTargets) {
190200const suffix = unmatched.includePattern ? ` (${unmatched.includePattern})` : "";
191-console.error(`[test] explicit test target matched no test files: ${unmatched.target}${suffix}`);
201+console.error(
202+`[test] explicit test target matched no test files: ${unmatched.target}${suffix}`,
203+);
192204}
193205printTestSummary("failed", 1, performance.now() - suiteStartedAt);
194206process.exitCode = 1;
@@ -276,17 +288,21 @@ async function main() {
276288console.error(
277289`[test] running ${parallelSpecs.length} Vitest shards with parallelism ${concurrency}`,
278290);
279-const { exitCode: parallelExitCode, timings } = await runVitestSpecsParallel(
280-parallelSpecs,
281-concurrency,
282-);
291+const {
292+exitCode: parallelExitCode,
293+ failures,
294+ timings,
295+} = await runVitestSpecsParallel(parallelSpecs, concurrency);
283296writeShardTimings(timings, process.cwd(), baseEnv);
284297printTestSummary(
285298parallelExitCode === 0 ? "passed" : "failed",
286299parallelSpecs.length,
287300performance.now() - suiteStartedAt,
288301"Vitest summaries above are per-shard, not aggregate totals.",
289302);
303+for (const line of formatFailedShardDigest(failures)) {
304+console.error(line);
305+}
290306releaseLockOnce();
291307if (parallelExitCode !== 0) {
292308process.exit(parallelExitCode);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。