-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Update Microsoft.CodeAnalysis.Workspaces.UnitTests to target netcoreapp3.1 #45813
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ade2db3
Update Microsoft.CodeAnalysis.Workspaces.UnitTests to target netcorea…
sharwell ec3faf9
Update Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests to target n…
sharwell d45cb21
Update Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests to tar…
sharwell e1f8663
Merge remote-tracking branch 'dotnet/master' into netcoreapp-workspac…
sharwell 129761f
Install ThrowingTraceListener with a module initializer
sharwell 7da2aa4
Merge remote-tracking branch 'dotnet/master' into netcoreapp-workspac…
sharwell 5a20683
Update module initializers
sharwell c8b43b3
Merge remote-tracking branch 'dotnet/master' into netcoreapp-workspac…
sharwell 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
126 changes: 66 additions & 60 deletions
126
src/Workspaces/CoreTest/CodeCleanup/ReduceTokenTests.cs
Large diffs are not rendered by default.
Oops, something went wrong.
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
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.
@tmat This is causing a problem because we expect the ThrowingTraceListener to be active, but it's not taking effect in .NET Core scenarios so we failfast instead.
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.
This doesn't seem like the right solution. We have
Debug.Assert
in many places.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.
Any suggestions for how to proceed here?
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.
Do we know why it doesn't work on Core? For now, perhaps we can skip fail-fast on Core.
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.
Debug.Assert
doesn't use trace listeners on .NET Core.I have not found a way to change this behavior without private reflection, and even if we go that route I'm not sure how to do it from a single location in the xunit startup process. Perhaps a custom MemberData property so it runs during discovery?
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 discussed this with @stephentoub , and it looks like we can still use
ThrowingTraceListener
, but we have to add it explicitly: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.
K. That pattern + module initailizers on .NET Core would seem to essentially cover this issue for us then.
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.
What release is the first to support module initializers? Are we already able to add one for the test helper assembly?
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.
The feature has been available in the runtime since 1.0 I believe. The language support will come in C# 9.0. The feature branch should get merged into the main branch sometime next week.
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.
This has been updated to use a module initializer to install the trace listener. There are two resulting impacts:
Debug.Assert
in any location where assertion might fail. Doing so will cause aFailFast
. Workaround: if/when this occurs, make the test class extendTestBase
to force module initialization via inheritance.preview
language version (Enable usage of preview language features #44485).