-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add basic regression testing for .NET 6 source generated JsonSerializerContext. #71850
Add basic regression testing for .NET 6 source generated JsonSerializerContext. #71850
Conversation
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsWe need to make sure that any changes we make to System.Text.Json metadata in v7 does not break source generated serializers produced by earlier versions of the SDK. This PR adds basic regression testing that hardcodes generated serializers using .NET SDK 6.0.301. For the moment it only smoke tests basic functionality rather than dealing with more involved test coverage but it should give us more confidence given all the refactoring that has taken place for v7.
|
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've not reviewed the content of the test coverage that these tests provide, but I like the approach here.
It doesn't need to hold up this PR, but it would be valuable to add a README.md to the Net60
folder that gives instructions for how the contents were produced.
I was kind of surprised we don't have a .gitignore
rule that ignores .g.cs
files by default too. You might want to consider adding a .gitignore
file to the SourceGenRegressionTests
folder that guarantees .g.cs
files don't get ignored from a parent folder's rules in the future.
I've added a README.md that points to this repo: https://github.com/eiriktsarpalis/stj-regressionsuite. It provides an entrypoint + basic automation needed to regenerate the needed source files. We can look at possibly incorporating automation in the main repo in the future. |
I just realized that I forgot to address the |
Cool; thanks. We'll want to pull that over into a dotnet repo, perhaps into https://github.com/dotnet/runtime-assets, where we already have the ability to create packages that provide assets used by tests in the runtime repo. No rush on that though; we can do it during RC2 or something. |
We need to make sure that any changes we make to System.Text.Json metadata in v7 does not break source generated serializers produced by earlier versions of the SDK. This PR adds basic regression testing that hardcodes generated serializers using .NET SDK 6.0.301. For the moment it only smoke tests basic functionality rather than dealing with more involved test coverage but it should give us more confidence given all the refactoring that has taken place for v7.