bigbluebutton-Github/bigbluebutton-tests/playwright/custom-reporter.js
Anton Barboza de Sá ebdddb8718
ci: Introduces custom reporter (automated tests) (#20712)
* core: create custom reporter for CI

* core: add step to remove unnecessary artifacts

* core: remove upload PR data step

* core: add locales to path-ignore, change matrix variable set way and add condition to avoid false run failure

* core: update emoji for in progress comment
2024-07-17 22:19:39 -03:00

24 lines
932 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class CustomReporter {
onTestEnd(test, result) {
const { retries } = test;
const { status, error, retry } = result;
const titlePath = test.titlePath();
titlePath.shift();
const logTitle = `[${titlePath.shift()}] ${titlePath.join(' ')}`.replace('@ci', '').trim();
if (status === 'failed') {
const baseMessage = `${logTitle}\n${error.stack}`;
if (retries != retry) {
const warningMessage = `Flaky (attempt #${retry + 1}) ────────────────────────────────────────────────────────────\n${baseMessage}\n`;
console.log(`::warning title=${logTitle}:: ${warningMessage}`.replace(/\n/g, '%0A '));
return;
}
console.log(`::error title=${logTitle}:: ${baseMessage}`.replace(/\n/g, '%0A '));
}
}
}
export default CustomReporter;