mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
ci: log mocha retries in spec runner (#49877)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Nilay Arya <84241885+nilayarya@users.noreply.github.com>
This commit is contained in:
@@ -189,6 +189,14 @@ app.whenReady().then(async () => {
|
||||
chai.config.truncateThreshold = 0;
|
||||
|
||||
const runner = mocha.run(cb);
|
||||
|
||||
const RETRY_EVENT = Mocha?.Runner?.constants?.EVENT_TEST_RETRY || 'retry';
|
||||
|
||||
runner.on(RETRY_EVENT, (test, err) => {
|
||||
console.log(`Failure in test: "${test.fullTitle()}"`);
|
||||
if (err?.stack) console.log(err.stack.split('\n').slice(0, 3).join('\n'));
|
||||
console.log(`Retrying test (${test.currentRetry() + 1}/${test.retries()})...`);
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.error('An error occurred while running the spec runner');
|
||||
console.error(err);
|
||||
|
||||
Reference in New Issue
Block a user