-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
test_runner: add level-based diagnostic handling for reporter #57923
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
Open
JacopoPatroclo
wants to merge
12
commits into
nodejs:main
Choose a base branch
from
JacopoPatroclo:feat/add-level-base-diagnostic-handaling-for-reporter
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
test_runner: add level-based diagnostic handling for reporter #57923
JacopoPatroclo
wants to merge
12
commits into
nodejs:main
from
JacopoPatroclo:feat/add-level-base-diagnostic-handaling-for-reporter
+59
−4
Conversation
This file contains hidden or 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
Added a parameter 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 - info : yellow - warn : red - error 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
implemented requested change by removing debug from reporterColorMap Refs: nodejs#55964 (review)
updated the documentation for the 'test:diagnostic' event to include the new level parameter. clarified its purpose, default value, and possible severity levels ('info', 'warn', 'error'). Fixes: nodejs#55922
Add a test in to verify that the diagnostic error messages about unmet coverage thresholds are displayed in red when using the spec reporter. Fixes: nodejs#55922
Added eslint-disable comment to bypass no-control-regex. This allows testing ANSI escape sequences for red color in error messages without triggering lint errors. Fixes: nodejs#55922
Updated the description of the parameter to note that color output is specific to the spec reporter. This helps users understand its behavior and create custom reporters with accurate expectations. Fixes: nodejs#55922
add a test to ensure that diagnostic events emitted by the test runner contain level parameter. Refs: nodejs#55964
Added eslint-disable-next-line to bypass no-unused-vars check ref: nodejs#55964
Co-authored-by: Harshil Patel <26harshilpatel11@gmail.com>
Review requested:
|
Hi @JacopoPatroclo, Thanks for working on it. I was bit busy with a new role. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #57923 +/- ##
==========================================
- Coverage 90.26% 90.26% -0.01%
==========================================
Files 630 630
Lines 185933 185945 +12
Branches 36447 36452 +5
==========================================
+ Hits 167840 167849 +9
- Misses 10971 10978 +7
+ Partials 7122 7118 -4
🚀 New features to boost your workflow:
|
pmarchini
approved these changes
Apr 26, 2025
jasnell
approved these changes
May 6, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
needs-ci
PRs that need a full CI run.
test_runner
Issues and PRs related to the test runner subsystem.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The aim is to pick the work done by @hpatel292-seneca here #55964 fixing a small issue on a test.