Unverified Commit fabab8cf authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

improve CI log (#55736)

### What?

* expands the first test failure
* uses an ❌ emoji for visibility
* adds (killed) to killed processes to not confuse them with errors

![image](https://github.com/vercel/next.js/assets/1365881/4735124b-ad76-4664-93ea-b893d41e8abd)


Closes WEB-1623
parent 5daf2ee5
......@@ -325,6 +325,8 @@ ${ENDGROUP}`)
'.bin',
`jest${process.platform === 'win32' ? '.CMD' : ''}`
)
let firstError = true
let killed = false
const runTest = (test = '', isFinalRun, isRetry) =>
new Promise((resolve, reject) => {
......@@ -411,13 +413,26 @@ ${ENDGROUP}`)
if (code !== 0 || signal !== null) {
if (hideOutput) {
await outputSema.acquire()
process.stdout.write(`${GROUP}${test} output\n`)
const isExpanded =
firstError && !killed && !shouldContinueTestsOnError
if (isExpanded) {
firstError = false
process.stdout.write(`❌ ${test} output:\n`)
} else if (killed) {
process.stdout.write(`${GROUP}${test} output (killed)\n`)
} else {
process.stdout.write(`${GROUP}❌ ${test} output\n`)
}
// limit out to last 64kb so that we don't
// run out of log room in CI
for (const { chunk } of outputChunks) {
process.stdout.write(chunk)
}
process.stdout.write(`end of ${test} output\n${ENDGROUP}\n`)
if (isExpanded) {
process.stdout.write(`end of ${test} output\n`)
} else {
process.stdout.write(`end of ${test} output\n${ENDGROUP}\n`)
}
outputSema.release()
}
const err = new Error(
......@@ -511,6 +526,7 @@ ${ENDGROUP}`)
console.error(`${test} failed to pass within ${numRetries} retries`)
if (!shouldContinueTestsOnError) {
killed = true
children.forEach((child) => child.kill())
cleanUpAndExit(1)
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment