Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
6adedb5e
Unverified
Commit
6adedb5e
authored
Jan 29, 2026
by
Jiwon Choi
Committed by
GitHub
Jan 29, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] Add test suite name for Tests failures table (#89258)
parent
cf07866e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
11 deletions
+41
-11
run-tests.js
run-tests.js
+41
-11
No files found.
run-tests.js
View file @
6adedb5e
...
@@ -113,13 +113,14 @@ const mockTrace = () => ({
...
@@ -113,13 +113,14 @@ const mockTrace = () => ({
// which types we have configured to run separate
// which types we have configured to run separate
const configuredTestTypes = Object.values(testFilters)
const configuredTestTypes = Object.values(testFilters)
/** @type {Map<string, { output: string, failedCases: string[] }>} */
const errorsPerTests = new Map()
const errorsPerTests = new Map()
async function maybeLogSummary() {
async function maybeLogSummary() {
if (process.env.CI && errorsPerTests.size > 0) {
if (process.env.CI && errorsPerTests.size > 0) {
const outputTemplate = `
const outputTemplate = `
$
{
Array
.
from
(
errorsPerTests
.
entries
())
$
{
Array
.
from
(
errorsPerTests
.
entries
())
.
map
(([
test
,
output
])
=>
{
.
map
(([
test
,
{
output
}
])
=>
{
return
`
return
`
<details>
<details>
<summary>
${
test
}
</summary>
<summary>
${
test
}
</summary>
...
@@ -133,20 +134,27 @@ ${output}
...
@@ -133,20 +134,27 @@ ${output}
})
})
.
join
(
'
\
n'
)}
`
.
join
(
'
\
n'
)}
`
// Build table rows with one row per failed test case
const tableRows = []
for (const [test, { failedCases }] of errorsPerTests.entries()) {
const testLink = `
<
a
href
=
"https://github.com/vercel/next.js/blob/canary/${test}"
>
$
{
test
}
<
/a>
`
if
(
failedCases
.
length
===
0
)
{
tableRows
.
push
([
'Unknown'
,
testLink
])
}
else
{
for
(
const
caseName
of
failedCases
)
{
tableRows
.
push
([
caseName
,
testLink
])
}
}
}
await
core
.
summary
await
core
.
summary
.
addHeading
(
'Tests failures'
)
.
addHeading
(
'Tests failures'
)
.
addTable
([
.
addTable
([
[
[
{
{
data
:
'Test Name'
,
header
:
true
},
data: 'Test suite',
{
data
:
'Test Path'
,
header
:
true
},
header: true,
},
],
],
...Array.from(errorsPerTests.entries()).map(([test]) => {
...
tableRows
,
return [
`
<
a
href
=
"https://github.com/vercel/next.js/blob/canary/${test}"
>
$
{
test
}
<
/a>`
,
]
}),
])
])
.
addRaw
(
outputTemplate
)
.
addRaw
(
outputTemplate
)
.
write
()
.
write
()
...
@@ -608,7 +616,7 @@ ${ENDGROUP}`)
...
@@ -608,7 +616,7 @@ ${ENDGROUP}`)
}
}
if (process.env.CI) {
if (process.env.CI) {
errorsPerTests.set(test.file,
output
)
errorsPerTests.set(test.file,
{ output, failedCases: [] }
)
}
}
if (isExpanded) {
if (isExpanded) {
...
@@ -704,6 +712,28 @@ ${ENDGROUP}`)
...
@@ -704,6 +712,28 @@ ${ENDGROUP}`)
'utf8'
'utf8'
)
)
const
obj
=
JSON
.
parse
(
testsOutput
)
const
obj
=
JSON
.
parse
(
testsOutput
)
// Extract failed test case names from Jest JSON output
if
(
!
passed
&&
process
.
env
.
CI
)
{
const
failedCases
=
[]
for
(
const
testResult
of
obj
.
testResults
||
[])
{
for
(
const
assertion
of
testResult
.
assertionResults
||
[])
{
if
(
assertion
.
status
===
'failed'
)
{
const
caseName
=
[
...(
assertion
.
ancestorTitles
||
[]),
assertion
.
title
,
].
join
(
' > '
)
failedCases
.
push
(
caseName
)
}
}
}
// Update errorsPerTests with failed case names
const
existing
=
errorsPerTests
.
get
(
test
.
file
)
if
(
existing
)
{
existing
.
failedCases
=
failedCases
}
}
obj
.
processEnv
=
{
obj
.
processEnv
=
{
NEXT_TEST_MODE
:
process
.
env
.
NEXT_TEST_MODE
,
NEXT_TEST_MODE
:
process
.
env
.
NEXT_TEST_MODE
,
HEADLESS
:
process
.
env
.
HEADLESS
,
HEADLESS
:
process
.
env
.
HEADLESS
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment