refactor(ci): simplify portable test failure details (#16415)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-03 17:34:10 +00:00
1 parent fd4c5aa149
commit c2b3ca2b11
1 file changed
+18 -22
+18 -22
View File
@@ -118,28 +118,24 @@ if (passed && verifyInventory) {
const publishesHistory = passed && !selected;
const skippedFiles = files.filter(({ state }) => state === "skipped");
const failureListLimit = 20;
const failureDetails =
!passed || failedFiles.length > 0
? [
`Failed test modules reported: ${failedFiles.length}.`,
...(incompleteFiles.length
? [
`Queued or pending test modules reported: ${incompleteFiles.length}.`,
]
: []),
...failedFiles
.slice(0, failureListLimit)
.map((name) => `- ${JSON.stringify(name)}`),
...(failedFiles.length > failureListLimit
? [
`… ${failedFiles.length - failureListLimit} more in the test report.`,
]
: []),
...(report.unhandledErrors === undefined
? []
: [`Unhandled Vitest errors reported: ${report.unhandledErrors}.`]),
]
: [];
const failureDetails = [];
if (!passed) {
failureDetails.push(`Failed test modules reported: ${failedFiles.length}.`);
if (incompleteFiles.length)
failureDetails.push(
`Queued or pending test modules reported: ${incompleteFiles.length}.`,
);
for (const name of failedFiles.slice(0, failureListLimit))
failureDetails.push(`- ${JSON.stringify(name)}`);
if (failedFiles.length > failureListLimit)
failureDetails.push(
`… ${failedFiles.length - failureListLimit} more in the test report.`,
);
if (report.unhandledErrors !== undefined)
failureDetails.push(
`Unhandled Vitest errors reported: ${report.unhandledErrors}.`,
);
}
const shadowNotes = [];
if (
process.env.CI_COMPARE_TEST_SHADOW === "true" &&