refactor(test): migrate to xUnit v3 - #10722
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the Orleans test suite and test infrastructure from xUnit v2 to xUnit v3, updating both package references and source-level test patterns so the suite continues to run under VSTest with existing trait/category filtering and skip semantics.
Changes:
- Updates package references to xUnit v3 (
xunit.v3*) andVerify.XunitV3, and adjusts test project output/entry-point behavior for v3 executable test apps. - Replaces v2-era skip/trait/test-lifetime patterns (SkippableFact/Theory,
IAsyncLifetimereturningTask, etc.) with xUnit v3 equivalents (SkipException.ForSkip,Assert.SkipWhen,ValueTasklifetimes,ITraitAttribute.GetTraits, etc.). - Preserves custom test executables (standalone silo hosts/benchmarks) by dispatching to xUnit’s generated runner when invoked by the test platform.
Show a summary per file
| File | Description |
|---|---|
| Directory.Packages.props | Switches centrally-managed versions from xUnit v2/SkippableFact/Verify.Xunit to xUnit v3 and Verify.XunitV3. |
| Directory.Build.props | Disables IsTestingPlatformApplication globally to keep VSTest execution behavior consistent during migration. |
| test/Directory.Build.props | Adds xUnit analyzer suppression and sets test projects to build as executables based on project name suffix. |
| test/TestInfrastructure/TestExtensions/TestClusterPerTest.cs | Updates test cluster lifetime contract to xUnit v3 IAsyncLifetime (ValueTask) and adds PreconditionsMet support. |
| test/TestInfrastructure/TestExtensions/TestCategory.cs | Reworks TestCategoryAttribute to xUnit v3 trait discovery via ITraitAttribute.GetTraits(). |
| test/TestInfrastructure/TestExtensions/TestUtils.cs | Converts environment prerequisite failures into xUnit v3 skip exceptions (SkipException.ForSkip). |
| test/TestInfrastructure/TestExtensions/TestOutputHelperExtensions.cs | Moves output helper extensions to the xUnit v3 namespace/API surface and avoids null-sensitive ToString(). |
| test/Benchmarks/Serialization/Comparison/ArraySerializeBenchmark.cs | Updates benchmark/test hybrid methods; currently introduces xUnit TestContext usage (see comment). |
| test/Benchmarks/Program.cs | Dispatches to xUnit’s generated entry point when invoked as a test platform application. |
| test/Orleans.Runtime.Tests/Program.cs | Preserves the standalone silo host entry point while dispatching test invocations to the xUnit-generated runner. |
| src/Orleans.Transactions.TestKit.xUnit/* | Converts transaction testkit runners from SkippableFact/Theory to xUnit v3 Fact/Theory patterns. |
Many test/**.cs files |
Mechanical updates: remove Xunit.Abstractions, replace SkippableFact/Theory with Fact/Theory, add cancellation tokens via TestContext.Current.CancellationToken, and update lifetime signatures to ValueTask. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 300/406 changed files
- Comments generated: 2
- Review effort level: Lite
ReubenBond
force-pushed
the
rb-migrate-xunit-v3
branch
from
August 20, 2026 21:45
f2aaab0 to
a7fcf73
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ReubenBond
force-pushed
the
rb-migrate-xunit-v3
branch
from
August 20, 2026 23:23
ba20727 to
576a967
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 75c4938a-e86a-4cf1-95d3-4695243217fc
This was referenced Sep 8, 2026
Closed
This was referenced Sep 16, 2026
Open
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.
xUnit v2 is no longer the current test platform for the repository's supported .NET targets. This migrates the Orleans test infrastructure and suite to xUnit v3 while preserving VSTest execution, existing trait filters, provider skip behavior, and custom test executable roles.
The migration:
IsTestingPlatformApplicationdisabled for VSTestIAsyncLifetime, dynamic skips, custom traits, test ordering, theory data, and output helper APIsThe package changes, remaining project fixes, and source/API migration are split into separate commits for reviewability.
Microsoft Reviewers: Open in CodeFlow