-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: improve playwright test reporting on github ci (#7650)
* ci: improve playwright test reporting on github ci * ci: temporarily use test command in packages/kit to avoid turbo prefix in output * fix: replace noisy github reporter with dot reporter * fix: restore original test command
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* @class | ||
* @implements {import('@playwright/test/reporter').Reporter} | ||
*/ | ||
export default class GithubFlakyWarningReporter { | ||
/** | ||
* @type {{ file: string; line: number; title: string; message: string; }[]} | ||
*/ | ||
_flaky = []; | ||
|
||
onBegin() { | ||
this._flaky = []; | ||
} | ||
/** | ||
* @param test {import('@playwright/test/reporter').TestCase} | ||
*/ | ||
onTestEnd(test) { | ||
if (test.outcome() === 'flaky') { | ||
const { file, line } = test.location; | ||
const title = `flaky test: ${test.title}`; | ||
const message = `retries: ${test.retries}`; | ||
this._flaky.push({ file, line, title, message }); | ||
} | ||
} | ||
|
||
onEnd() { | ||
this._flaky.forEach(({ file, line, title, message }) => { | ||
console.log(`::warning file=${file},line=${line},title=${title}::${message}`); | ||
}); | ||
} | ||
|
||
printsToStdio() { | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters