Uh oh!
There was an error while loading. Please reload this page.
Remove pinned XunitAnalyzersVersion from Versions.props - #118241
Conversation
eca1e64 to
df2b47fCompare…ed by the parameters of the test method
df2b47f to
8e49b74Compare8e49b74 to
3d6b698Compare3d6b698 to
c340a3cComparec340a3c to
9c7794eCompare9c7794e to
a6b34adCompareThere was a problem hiding this comment.
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")]
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
* Remove pinned XunitAnalyzersVersion from Versions.props Fixesdotnet#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
MichalStrehovsky
commented
Aug 5, 2025
I'm seeing coreCLR pri-1 outerloop failures that look like: Could this be related to the upgraded xunit analyzers? |
akoeplinger
commented
Aug 5, 2025
yes. I'll fix it |
Addresses all the new warnings in the newer analyzer version.
Fixes#97088