print the first 10 failed tests

This commit is contained in:
A. J. Kaptijn 2024-01-24 09:13:51 +01:00
parent a3bd4352e9
commit 108abd4de9
2 changed files with 40 additions and 0 deletions

View file

@ -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
}