-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Remove pinned XunitAnalyzersVersion from Versions.props #118241
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
eca1e64
to
df2b47f
Compare
…ed by the parameters of the test method
df2b47f
to
8e49b74
Compare
8e49b74
to
3d6b698
Compare
3d6b698
to
c340a3c
Compare
c340a3c
to
9c7794e
Compare
9c7794e
to
a6b34ad
Compare
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 addresses fixes for XUnit analyzer issues by updating test method signatures to use nullable parameter types where null values are being tested. The changes ensure that test parameter declarations are correctly annotated as nullable when the test methods are designed to accept null values through inline data attributes.
- Updates test method parameter types to use nullable annotations (e.g.,
string?
,Type?
, etc.) - Fixes test methods to properly handle async/await patterns where incorrect return types were used
- Includes minor project file updates to include necessary test infrastructure files
Reviewed Changes
Copilot reviewed 299 out of 377 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/AssemblyMetadataAttributeTests.cs | Updated test parameter to accept nullable string values |
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/NullableTests.cs | Updated test parameter to accept nullable Type values |
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/IntPtrTests.cs | Updated test parameters to accept nullable object values |
src/libraries/System.Net.Sockets/tests/FunctionalTests/DisconnectTest.cs | Fixed async test methods to return Task instead of void |
src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSExportTest.cs | Fixed async test method return type |
src/libraries/System.IO.FileSystem.Tests/File/AppendAllBytesAsync.cs | Fixed async test method to properly await operations |
src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileSystemTest.cs | Updated TheoryData generic types for better type safety |
src/libraries/System.Linq/tests/WhereTests.cs | Fixed test assertions to use appropriate methods |
Many other test files | Similar updates to parameter nullability annotations and async patterns |
Comments suppressed due to low confidence (1)
src/libraries/System.Net.Sockets/tests/FunctionalTests/DisconnectTest.cs:76
- This ActiveIssue attribute was added but there's no context about why this test method was marked as having an active issue. The GitHub issue reference should be validated to ensure it's correctly tracking the actual problem.
[ActiveIssue("https://github.com/dotnet/runtime/issues/118314")]
* Remove pinned XunitAnalyzersVersion from Versions.props Fixes dotnet#97088 * Fix xUnit1012: Null should not be used for value type parameters * Fix xUnit1037: There are fewer theory data type arguments than required by the parameters of the test method * Fix xUnit1041: Fixture arguments to test classes must have fixture sources * Fix xUnit1048: Avoid using 'async void' for test methods as it is deprecated in xUnit.net v3 * Fix xUnit2021: Async assertions should be awaited * Fix xUnit2027: Comparison of sets to linear containers have undefined results * Fix xUnit2029: Do not use Assert.Empty to check if a value does not exist in a collection * Fix xUnit2031: Do not use Where clause with Assert.Single * Disable test that started erroring
I'm seeing coreCLR pri-1 outerloop failures that look like:
Could this be related to the upgraded xunit analyzers? |
yes. I'll fix it |
Addresses all the new warnings in the newer analyzer version.
Fixes #97088