-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat: Display warnings only on test failure #35464
Conversation
This comment has been minimized.
This comment has been minimized.
const testRun = new TestRun(this._config, reporter); | ||
const status = await runTasks(testRun, [ | ||
...createPluginSetupTasks(this._config), | ||
createLoadTask('in-process', { failOnLoadErrors: true, filterOnly: false }) |
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.
Hmm... If we store warnings in .last-run.json
, why do we need to load any tests? I'd think we have all the information needed for the warning in the json, so we can just print it? If so, I'd put all this logic into a separate file warnings.ts
and let it manage both the "warnings data in last-run.json" and the terminal output.
That said, I think we should make warnings conveniently available to other reporters. For example, do we want to show warning per test result in the html reporter, or do we want a similar summary? If we want a summary, perhaps generate it and attach? Needs brainstorming.
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.
Storing all of the necessary test information is valid, but I didn't want to deviate significantly from the current patterns. If we did store more information than just test ID, would we store code frames? Or would we just store the test name and still fetch the code frame at runtime?
You don't consider the annotation reporter API to be sufficient? A reporter can read all warning annotations onEnd
.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Looks good!
Test results for "tests 1"5 flaky39109 passed, 807 skipped Merge workflow run. |
Improves warning display via terminal reporters. Warnings will only be displayed if the test failed. Warning messages for unawaited promises display a prompt for the corresponding
eslint
rules for more detailed investigation.