mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 14:57:09 +01:00
print the first 10 failed tests
This commit is contained in:
parent
a3bd4352e9
commit
108abd4de9
2 changed files with 40 additions and 0 deletions
21
src/main.ts
21
src/main.ts
|
|
@ -157,6 +157,27 @@ class TestReporter {
|
|||
|
||||
if (results.some(r => r.shouldFail)) {
|
||||
core.setFailed(`Failed test were found and the results could not be written to github, so fail this step.`)
|
||||
|
||||
let counter = 0
|
||||
core.startGroup('Failed tests')
|
||||
for (const r of results.filter(r => r.shouldFail)) {
|
||||
for (const rr of r.results) {
|
||||
for (const s of rr.failedSuites) {
|
||||
for (const g of s.failedGroups) {
|
||||
for (const t of g.failedTests) {
|
||||
if (++counter > 10) {
|
||||
core.endGroup()
|
||||
return
|
||||
}
|
||||
|
||||
core.info(`${t.name}: ${t.error?.message}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
core.endGroup()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue