-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Enable Native AOT testing in System.Text.Json. #86975
Enable Native AOT testing in System.Text.Json. #86975
Conversation
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsFixes #73431.
|
src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.Generic.Read.cs
Show resolved
Hide resolved
src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.AsyncEnumerable.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.Generic.Read.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/tests/Common/ExtensionDataTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/tests/Common/ExtensionDataTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/tests/Common/TestClasses/TestClasses.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Text.Json/tests/Common/JsonCreationHandlingTests.Generic.cs
Show resolved
Hide resolved
...aries/System.Text.Json/tests/Common/ReferenceHandlerTests/ReferenceHandlerTests.Serialize.cs
Outdated
Show resolved
Hide resolved
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
…ress misc feedback.
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
|
||
[Theory] | ||
[MemberData(nameof(GetAsyncEnumerableSources))] | ||
public async Task WriteNestedAsyncEnumerable_DTO<TElement>(IEnumerable<TElement> source, int delayInterval, int bufferSize) |
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 test was identical to the one above, so I deleted it.
@@ -1049,6 +1049,7 @@ public async Task InvalidJsonFails() | |||
await Assert.ThrowsAsync<JsonException>(() => Serializer.DeserializeWrapper<Point_2D_Struct>("{true")); | |||
} | |||
|
|||
#if !BUILDING_SOURCE_GENERATOR_TESTS // Anonymous types not supported in source gen |
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 test is hardcoding reflection, so I'm just disabling it for source gen.
private static void ExtensionProperty_SupportsWritingToCustomSerializerWithOptionsInternal<TDictionary, TConverter>() | ||
where TDictionary : new() | ||
where TConverter : JsonConverter, new() | ||
[MemberData(nameof(GetCustomOverflowConverters))] |
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.
Refactored the tests somewhat to reduce the number of generic parameters needed to drive the tests.
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.
Looks good to me from NativeAOT perspective, but can't speak about the test changes in general. Thank you!
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/roslyn3.11.rd.xml
Show resolved
Hide resolved
<Directives> | ||
<Application> | ||
<!-- NB Shared specializations must also be replicated in the roslyn3.11.rd.xml file --> | ||
<Assembly Name="System.Text.Json.SourceGeneration.Roslyn4.4.Tests"> |
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.
why are those needed? Do we know the reason they're trimmed out?
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.
They are helping the AOT compiler generate generic method specializations we know will be needed at runtime (but can't be inferred at compile time).
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 they can't be inferred?
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.
It's the usual issue of trying to do Type.MakeGenericType
/Method.MakeGenericMethod
in AOT. We're working on a fix specifically for theories though: #86975 (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.
LGTM, thanks!
Fixes #73431. Fixes #86973.