-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add test summary always in terminal logger #12801
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
Conversation
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.
Pull Request Overview
This PR fixes an issue where test run summaries were missing from the terminal logger output when the terminal node becomes null before receiving the test finish message. The fix ensures that test summary messages (TLTESTFINISH) are processed even when the active node is unavailable, while still protecting node-dependent operations (TLTESTPASSED/TLTESTSKIPPED) with explicit null checks.
Key Changes
- Removed the
node != nullcondition from the outer check, allowing all test-related extended messages to be processed regardless of node state - Added explicit nullable type annotation to the node variable for clarity
- Added null checks specifically for TLTESTPASSED and TLTESTSKIPPED cases that require the node to update status
- Removed trailing whitespace for code cleanliness
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.
These changes look reasonable and safe to merge to me.
It is unclear what leads to the node to be null, so we will need to investigate it. I will create an issue for that and take a look. I do not think it has to block this PR.
JanProvaznik
left a comment
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.
makes sense to decouple
regarding when the node is null, copilot had an interesting hypothesis that it might be due to state not being restored after returning from MSBuild task
|
/backport to vs17.14 |
|
Started backporting to |
|
@JanProvaznik backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Add test summary always in terminal logger
Using index info to reconstruct a base tree...
M src/Build/Logging/TerminalLogger/TerminalLogger.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Build/Logging/TerminalLogger/TerminalLogger.cs
CONFLICT (content): Merge conflict in src/Build/Logging/TerminalLogger/TerminalLogger.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Add test summary always in terminal logger
Error: The process '/usr/bin/git' failed with exit code 128 |
**Description** Running tests with dotnet test, users see inconsistent number of projects and tests reported in the view. This is a UI only issue, failing tests will still fail the build. It is still worth fixing the issue because it makes the runs show repeatable numbers of tests to the user. The terminal node can be null before we receive the finish message. This will cause that some summaries are not accounted for and will be missing in the final output. The node is null for this reason: #12819 That fix is not backported. **Customer Impact:** Multiple runs of the same test suite report different total counts of tests and projects. **Regression?** No, this was never working correctly since the beginning of test reporting in Terminal Logger. **Risk:** Low, it impacts UI only. Link the PR to the original issue and to the PR to main. PR to main is merged: #12801 Fixes microsoft/vstest#15307 No additional impact on packages or localization.
Fixes microsoft/vstest#15307
Context
The terminal node can be null before we receive the finish message. This will cause that some summaries are not accounted for and will be missing in the final output.
Changes Made
Always update data for messages that don't require active node.
Testing
Tested manually on local build of msbuild.
I was not able to trace why the node becomes null, please help.
Notes