Skip to content

Migrate union roundtrip tests to C# 15 native unions - #170

Merged
sadicangel merged 1 commit into
mainfrom
migrate-native-union-roundtrips
Oct 8, 2026
Merged

sadicangel merged 1 commit into
mainfrom
migrate-native-union-roundtrips

Conversation

@sadicangel

Copy link
Copy Markdown
Owner

The Docker union tests currently exercise interface/object representations, and Chr skips mixed-object unions. Migrate both suites to C# 15 native unions while keeping interface coverage in the fast serializer tests and C# 14 unit snapshots.

  • Enable union preview generation in both roundtrip projects and register the generated Notification and PaymentRecord builders for Chr.
  • Replace the old union roundtrip tests with native record and mixed-union cases. Verify the decoded runtime case type as well as its value.
  • Extend the payment fixture with fixed and enum branches while retaining null, string, integer, and record coverage. Make shared test serialization helpers work with both representations.
  • Keep the Apache enum case explicitly skipped pending apache/avro#4031. Chr now runs every mixed-union case.
  • Simplify README prerequisites to state the SDK 10.0.100 minimum directly.

Validation:

  • Release solution build: zero warnings/errors.
  • Three unit suites and both fast integration suites: 1,196 passed.
  • Docker roundtrips: Apache 15 passed / 2 skipped; Chr 16 passed / 1 skipped. Skips cover the existing self-reference limitation and the Apache enum issue.
  • Packed consumers: 6 runs on SDK 10.0.401 and 9 on SDK 11.0.100-preview.6.26359.118 passed; generated-source parity passed.
  • git diff --check passed.

The minimum-SDK command, ./tests/AvroSourceGenerator.PackageCompatibility/Run-Compatibility.ps1 -PackagePath artifacts/packages/AvroSourceGenerator.0.0.0-native-roundtrip-review.nupkg -SdkVersion 10.0.100 -ExpectedRoslynApiVersion 5.0 -OutputDirectory artifacts/manifests/native-roundtrip-review/minimum, could not run because SDK 10.0.100 is not installed locally. CI retains that baseline check.

@sadicangel
sadicangel merged commit 60b3bc5 into main Oct 8, 2026
4 checks passed
@sadicangel
sadicangel deleted the migrate-native-union-roundtrips branch October 8, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant