-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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 #55964
Open
hpatel292-seneca
wants to merge
11
commits into
nodejs:main
Choose a base branch
from
hpatel292-seneca:issue-55922-b
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.
+58
−4
Open
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7dda539
test_runner: add level parameter to reporter.diagnostic
hpatel292-seneca c618874
test_runner: enhance #handleEvent to handle levels
hpatel292-seneca 2ac841c
test_runner: extend reporterColorMap for levels
hpatel292-seneca 1ca0d45
test_runner: set level for coverage threshold
hpatel292-seneca 038b0f8
test_runner: remove debug from reporterColorMap
hpatel292-seneca b490d9d
doc: update 'test:diagnostic' event to include level parameter
hpatel292-seneca 3e4d5e6
test: add test for spec reporter red color output
hpatel292-seneca 4048621
test: disable no-control-regex for color regex
hpatel292-seneca 33b961d
doc: clarify diagnostic behavior in API docs
hpatel292-seneca b1c8033
test: validate diagnostic events in test runner
hpatel292-seneca c06e9e1
test: Fix Lint error
hpatel292-seneca File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
hey @hpatel292-seneca, it seems this test is failing in the CI.
Could you please take a look at it?
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.
Hey @pmarchini, I tried reading logs on failed tests and it seems like this regex
![image](https://private-user-images.githubusercontent.com/100322816/397823459-69f44e1a-83ff-4b0f-aa32-4026e3fd1588.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMjQxMDAsIm5iZiI6MTczOTIyMzgwMCwicGF0aCI6Ii8xMDAzMjI4MTYvMzk3ODIzNDU5LTY5ZjQ0ZTFhLTgzZmYtNGIwZi1hYTMyLTQwMjZlM2ZkMTU4OC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQyMTQzMjBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wZjUwZDAyY2JhYjk4MDRlZDA4MmE2NjgzZjBjNDYwZmRkNGI0Y2ZjOTE2YzY3NTlkNjJhMjAxMmJkZjg2Y2JiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.PtIifdNSp9UY9TseBqTPeX4edCjcQ6gr_ga_5FQi9Ng)
is not matching with the output. But as we are not logging anything I am not sure what we are getting output here.
But this test is running as expected and passing locally and in GitHub Action CI.
![image](https://private-user-images.githubusercontent.com/100322816/397825708-39e99d70-e411-4aa7-975a-5a42c5e97434.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMjQxMDAsIm5iZiI6MTczOTIyMzgwMCwicGF0aCI6Ii8xMDAzMjI4MTYvMzk3ODI1NzA4LTM5ZTk5ZDcwLWU0MTEtNGFhNy05NzVhLTVhNDJjNWU5NzQzNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQyMTQzMjBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zYjk1ZTg1ZmQ0NjBlNjhhYTg0MmY3ZDdhMTc2NTQ4ZjAyY2JlMTk1OTVhNjMzMTk5ZWY1MTc1NjQ4ZGMzOGI1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.-kfo1yMkjpfMYptcQOrFgytv6vZ4dMSxgSAEgZ-M75g)
Github Action run: https://github.com/nodejs/node/actions/runs/12320594158/job/34394971556
Below is the SS of the locally run test
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.
https://ci.nodejs.org/job/node-test-commit-osx/nodes=osx11-x64/62632/testReport/junit/(root)/parallel/test_runner_coverage_thresholds/ <-- here one CI failure
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.
Yes, I saw this CI failure but I am not sure what is causing the failure as this test is running as expected on my local machine. I tried reading logs on CI but I can't find anything. Is there any way I can debug those CI runs??
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.
Hey @hpatel292-seneca, if you follow the link I've shared, you will find the description of the error.
It seems that the expected red error does not match any part of the output.
I've restarted many times, and the error systematically appears across different OS.
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.
Hey @pmarchini, I got your point but the test is running as expected with red color on my machine.
For example: I am printing output in the test like this
And this is the output I am getting:
![image](https://private-user-images.githubusercontent.com/100322816/401594910-b0909616-44d9-4d65-b7e2-7b6a4b0a5f02.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMjQxMDAsIm5iZiI6MTczOTIyMzgwMCwicGF0aCI6Ii8xMDAzMjI4MTYvNDAxNTk0OTEwLWIwOTA5NjE2LTQ0ZDktNGQ2NS1iN2UyLTdiNmE0YjBhNWYwMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQyMTQzMjBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03MWVkYTRiMTc0MGIyYWQ5NjQzN2VmMTg1YjM5M2QxZDg4M2RiOGNhNTA1NzY1NjlmZGE1Njc2MDQ3MTBiN2RmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.abPsM98-MDu3OD8f2lhfw61PB0dSi2GD-JnQNPR-cSY)
And here is the logs of failed pipeline run
So basically, it is not even printing the coverage error which I think it shoud print if I am using this flags
--experimental-test-coverage
,${coverage.flag}=99
, and--test-reporter', 'spec
which I am using in the test.Do you think it is a environment or configuration issue??
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.
I would say yes but in the CI it's also failing under Windows OS