-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: split output clients by capabilities and base dir #34135
base: main
Are you sure you want to change the base?
Conversation
341e60d
to
fe12c7e
Compare
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"1 failed 7 flaky37395 passed, 650 skipped Merge workflow run. |
githubLogger = new GitHubLogger(); | ||
|
||
constructor(options: { omitFailures?: boolean } = {}) { | ||
super(options); | ||
this.screen.colors = noColors; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid changing the global terminalScreen.colors
and messing up other reporters:
this.screen.colors = noColors; | |
this.screen = { ...this.screen, colors: noColors }; |
@@ -222,7 +222,7 @@ class JSONReporter implements ReporterV2 { | |||
} | |||
|
|||
private _serializeError(error: TestError): JSONReportError { | |||
return formatError(error, true); | |||
return formatError(nonTerminalScreen, error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a behavior change. Previously, we were always coloring the code snippet, and now we do it conditionally based on isTTY/PLAYWRIGHT_FORCE_TTY/FORCE_COLOR/DEBUG_COLORS.
Noticing here to figure out whether this is intentional.
|
||
type MarkdownReporterOptions = { | ||
configDir: string, | ||
outputFile?: string; | ||
}; | ||
|
||
|
||
class MarkdownReporter extends BaseReporter { | ||
class MarkdownReporter extends TerminalReporter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reporter seems to be a non-terminal one. I think it is more like the json/junit.
@@ -160,6 +160,6 @@ class ListModeReporter implements ReporterV2 { | |||
|
|||
onError(error: TestError) { | |||
// eslint-disable-next-line no-console | |||
console.error('\n' + formatError(error, false).message); | |||
console.error('\n' + formatError(terminalScreen, error).message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we did not want colors here at all, which seems consistent with plain console.log()
above instead of using formatTitle()
. Should we have a separate noColorsScreen
?
@@ -95,7 +95,7 @@ export function createErrorCollectingReporter(writeToConsole?: boolean): ErrorCo | |||
onError(error: TestError) { | |||
errors.push(error); | |||
if (writeToConsole) | |||
process.stdout.write(formatError(error, colors.enabled).message + '\n'); | |||
process.stdout.write(formatError(terminalScreen, error).message + '\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be nonTerminalScreen
instead?
Fixes #34125