-
Notifications
You must be signed in to change notification settings - Fork 29.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
test_runner: add level-based diagnostic handling for reporter #55957
Conversation
Added a parameter to to allow severity-based formatting for diagnostic messages. Defaults to 'info'. This update enables better control over message presentation (e.g., coloring) based on severity levels such as 'info', 'warn', and 'error'. Refs: nodejs#55922
Updated to process the parameter for events. Messages are now formatted with colors based on the (e.g., 'info', 'warn', 'error'). This change ensures diagnostic messages are visually distinct, improving clarity and reducing debugging effort during test runs. Refs: nodejs#55922
Enhanced to include colors for the following diagnostic levels: : blue : gray : yellow : red Ensures consistency in color-coding across the reporter. Refs: nodejs#55922
Updated coverage threshold checks in to use the parameter when calling . Errors now use the 'error' level for red-colored formatting. This ensures coverage errors are highlighted effectively in the output. Fixes: nodejs#55922
Review requested:
|
Hi @pmarchini, Here is the PR and the demo of it I tested locally. I am not sure where to add test case for the change, I read this https://github.com/nodejs/node/blob/main/doc/contributing/writing-tests.md but I am still not sure and I tried searching existing test case for
|
And I just noticed that my vscode formatter formatted the files I worked with. Do you want that or you want me to revert it back? |
Hey @hpatel292-seneca, about formatting absolutely, only changes strictly related to the issue must be present in the PR, also make sure you run linting via Also, have you run the tests? I would expect these changes to potentially break some existing tests |
Hi @pmarchini, Run tests and I got few tests failing which I tried to look at but not able to understand exact error, but I tried building Node based on main branch without my changes and tried running test cases and it is also failing same test cases. Here is screenshot of tests failing on main And here is tests failing on my issue branch All the tests which are failing are same. Maybe my pc is missing some configuration! |
I'm closing this PR as it duplicates: Please avoid opening duplicate PRs 😊 |
This fixes #55922
Change summary
Updated the reporter.diagnostic to accept level parameter like this
Then I updated
#handleEvent
like thisAnd I am Updated
reporterColorMap
like thisand color already contain logic for this colors
I also set the reporter.diagnostic call from test.js like this (level="Error")
Here is Demo output: