Add serializer conformance tests and baselines#10034
Merged
ReubenBond merged 1 commit intoApr 23, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds snapshot-based conformance coverage for Orleans’ generated serializer, providing both byte-level baselines and human-readable formatted snapshots to detect wire-format drift as serializer/source-generator behavior evolves.
Changes:
- Introduce
GeneratedSerializerBitwiseCompatibilityTestswhich asserts bitwise-stable payloads against checked-in hex baselines and (where supported) Verify-based formatted snapshots. - Add Verify.Xunit dependency for non-netcoreapp3.1 TFMs to support snapshot verification.
- Check in baseline (
*.verified.hex.txt) and formatted (*.verified.txt) snapshot artifacts for the new test suite.
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.Serialization.UnitTests/GeneratedSerializerBitwiseCompatibilityTests.cs | New bitwise compatibility + formatted snapshot tests for generated serializer payloads. |
| test/Orleans.Serialization.UnitTests/Orleans.Serialization.UnitTests.csproj | Adds Verify.Xunit for non-netcoreapp3.1 targets. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.WrapsMyForeignLibraryType_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for WrapsMyForeignLibraryType exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.WrapsMyForeignLibraryType_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for WrapsMyForeignLibraryType exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.SubClassWithRequiredMembersInBase_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for subclass required-members-in-base scenario. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.SerializableClassWithCompiledBase_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for compiled-base-class scenario. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.ReadonlyGenericPersonExternalStruct_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for readonly generic external struct scenario. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.Person5_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for Person5 exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.Person5_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for Person5 exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.Person4_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for Person4 exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.Person3_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for Person3 exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.Person3_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for Person3 exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.Person2External_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for external Person2 exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.Person2External_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for external Person2 exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.Person2ExternalStruct_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for external Person2 struct exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.OuterInnerNonGen_Untyped_MatchesBaseline.verified.hex.txt | Hex baseline for untyped outer/inner non-generic case. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.OuterInnerGen_Untyped_MatchesBaseline.verified.hex.txt | Hex baseline for untyped outer/inner generic case. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.NestedGenericPoco_Untyped_MatchesBaseline.verified.hex.txt | Hex baseline for nested generic POCO untyped serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.NestedGenericPoco_Untyped_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for nested generic POCO untyped serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.MySecondForeignLibraryType_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for second foreign-library type exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.MySecondForeignLibraryType_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for second foreign-library type exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.MyFirstForeignLibraryType_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for first foreign-library type exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.MyFirstForeignLibraryType_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for first foreign-library type exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.ImmutableStruct_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for immutable struct exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.ImmutableClass_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for immutable class exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GenericPocoString_Untyped_MatchesBaseline.verified.hex.txt | Hex baseline for generic POCO untyped serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GenericPocoString_Untyped_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for generic POCO untyped serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GenericPersonExternal_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for generic external person exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GenericPersonExternal_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for generic external person exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GenericPersonExternalStruct_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for generic external struct exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GenericPersonExternalStruct_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for generic external struct exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GeneratedRecordSerializer_UntypedRoot_MatchesBaseline.verified.hex.txt | Hex baseline for record serializer with untyped root. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GeneratedRecordSerializer_UntypedRoot_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for record serializer with untyped root. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GeneratedPolymorphicSerializer_BaseType_MatchesBaseline.verified.hex.txt | Hex baseline for polymorphic serialization via base type. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GeneratedPolymorphicSerializer_BaseType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for polymorphic serialization via base type. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GeneratedClassSerializer_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for baseline class exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GeneratedClassSerializer_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for baseline class exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GeneratedAutoFieldIdSerializer_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for auto-field-id serializer exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.GeneratedAutoFieldIdSerializer_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for auto-field-id serializer exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.DuplicateReferences_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for duplicate-reference tracking behavior. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.DuplicateReferences_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for duplicate-reference tracking behavior. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.DuplicateReferencesSuppressTracking_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for duplicate refs with suppress-tracking behavior. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.DuplicateReferencesSuppressTracking_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for duplicate refs with suppress-tracking behavior. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.DerivedFromDictionary_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for derived dictionary exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.DerivedFromDictionary_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for derived dictionary exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.ClassWithTypeFields_Untyped_MatchesBaseline.verified.hex.txt | Hex baseline for type-field-containing class untyped serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.ClassWithTypeFields_Untyped_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for type-field-containing class untyped serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.ClassWithRequiredMembers_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for required-members class exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.ClassWithRequiredMembers_ExactType_Formatted_MatchesSnapshot.verified.txt | Formatted snapshot for required-members class exact-type serialization. |
| test/Orleans.Serialization.UnitTests/snapshots/GeneratedSerializerBitwiseCompatibilityTests.ClassWithImplicitFieldIds_ExactType_MatchesBaseline.verified.hex.txt | Hex baseline for implicit field-id generation behavior. |
Copilot's findings
- Files reviewed: 50/50 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR add snapshot-based testing for the serializer to help ensure we don't break things as we make changes to the serializer or source generator infrastructure.
Microsoft Reviewers: Open in CodeFlow