Repository navigation
perf(tests): decouple generator and serialization test graphs - #11646
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the test dependency cleanup.
No open issues 🎉
What changed in this PR
This PR reduces the build dependencies of the generator and serialization test suites by source-linking shared helpers instead of referencing the runtime-test executable. The XML helper retains its existing ownership and behavior in TestGrainInterfaces.
Changes:
- Source-link test traits into both focused suites and the XML codec into serialization tests.
- Extract the XML codec and surrogate into a standalone, shared source file.
- Remove DefaultCluster.Tests’ unused generator-test reference and add an explicit Xunit import.
| File | Description |
|---|---|
| test/Orleans.Serialization.UnitTests/Orleans.Serialization.UnitTests.csproj | Links shared traits and XML helpers; removes the runtime-test reference. |
| test/Orleans.DefaultCluster.Tests/Orleans.DefaultCluster.Tests.csproj | Removes the unused generator-test reference. |
| test/Orleans.DefaultCluster.Tests/GrainActivateDeactivateTests.cs | Adds an explicit Xunit import. |
| test/Orleans.CodeGenerator.Tests/Orleans.CodeGenerator.Tests.csproj | Links shared traits; removes the runtime-test reference. |
| test/Grains/TestGrainInterfaces/EventSourcing/XDocumentSerialization.cs | Houses the extracted XML codec and surrogate without behavioral changes. |
| test/Grains/TestGrainInterfaces/EventSourcing/IChatGrain.cs | Removes the extracted helper definitions and their unused imports. |
Review effort: Balanced
Code coverage
Report-only conclusion: improved. The current-main baseline is commit Coverage combines every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS, using canonical physical source and branch identities. The comparison remains report-only while normal line and branch variance is calibrated. Coverage details |
6d6c991 to
cff434f
Compare
Source-link canonical test traits and the shared XML codec instead of inheriting the Runtime.Tests deployment graph. Keep the XML helper in its original grain-interface assembly and retain its wire shape and deep-copy behavior. Remove DefaultCluster.Tests' unused generator-test executable reference and make its Xunit import explicit so the focused suites remain leaf assemblies.
Replace cross-project trait and XML source inclusions with TestUtilities project references. Compile each helper once while keeping generator and serialization loops independent of runtime-test deployment.
Give the landed generic record and union metadata regression a two-type FSharp fixture which owns its sources and references only serialization abstractions. Preserve its member IDs, nested union-case assertions, and diagnostics while leaving runtime FSharp models unchanged. Refresh shared test helper ownership guidance after moving traits and XML serialization into TestUtilities.
Give serialization tests and event-sourced grains their own small XML helper implementations. Keep TestUtilities limited to shared test traits without serialization or code-generation dependencies. Replace cross-project AOT fixture source inclusions with independent local copies, preserving every payload, assertion, native scenario, and diagnostic gate.
Reconcile the independent AOT contract copies with the landed GeneratedContext family, preserving context metadata, nested import cases, native gates, and local fixture ownership.
bf29381 to
a96293e
Compare
Use the owned raw FSharp model fixture and in-memory generated CSharp service images instead of reading unreachable runtime-test output directories. Preserve full/reference service rejection cases and the original multicase struct union shape. Grant the fixed service producer friend access to internal FSharp union-case types, matching the existing generated-service boundary. Both full suites pass after isolated rebuilds with the old model/service DLLs absent.

Generator and serialization tests inherit Azure providers, test grains, F# grain builds, and versioned-grain deployment preparation through a reference to the runtime-test executable. Their build paths should instead follow the helpers and metadata fixtures they actually consume.
TestUtilitiesowns only the shared suite/provider/area/category attributes. Generator tests, serialization tests, clustering test-kit tests, andTestExtensionsconsume this small, non-packable library through ordinary project references. It has no Orleans serialization or code-generation dependency.Serialization tests and event-sourced test grains each own a local XML codec/surrogate. Both copies retain the XML text format, member ID, and deep-copy behavior. The grain copy retains its original namespace and assembly ownership; the serialization-test copy lives in that suite's namespace.
Give the generator and serialization suites independent local copies of their AOT contract/payload fixtures, and give the native smoke project local copies of its DI and grain-reference fixtures. These replace cross-project source inclusions while preserving the fixture implementations, assertions, native scenarios, and diagnostic gates. The local context/factory copies use the landed
GeneratedContext,GeneratedContextType<T>, andAddGeneratedContextAPIs and retain the new context contracts.The landed
ExtractReferenceAssemblyData_PreservesFSharpRecordsAndUnionCasesregression gets a small, source-owningFSharpCodeGenModelslibrary containing genuine Orleans-attributed generic record and union declarations. Its assertions still cover the generic shapes, record member ID, nested union-case identity, and empty diagnostics. Existing F# runtime models, grains, and their broader coverage retain their original ownership. The fixture depends only on serialization abstractions and the existing FSharp.Core package. Standard raw-fixtureProduceReferenceAssembly=falsesettings are retained; consumers use ordinary project references withoutReferencePathoverrides.Remove
DefaultCluster.Tests' unused reference to the generator-test executable and make its formerly transitive Xunit import explicit. Its runtime-codegen grains and cluster fixtures retain their existing ownership.These are unique-project closures across declared frameworks. The focused graphs retain a small explicit F# metadata fixture while shedding the runtime-test and versioned-grain deployment graph. Elapsed-time speedups are unclaimed.
Full generator and serialization suites pass on net8 and net10, including the landed F# metadata regression and all XML cases. Existing test coverage remains present; the landed API rename changes three invalid-context theory argument identities, and current main adds generator cases. Trait contracts and XML chat tests pass on both frameworks. DI, grain-reference, context, and factory native smoke scenarios publish and execute through the repository's diagnostic gates.
Microsoft Reviewers: Open in CodeFlow