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.
|
jeffhandley
left a comment
There was a problem hiding this comment.
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.