Repository navigation
Migrate test suite to xUnit v3 and Microsoft Testing Platform - #9871
Merged
Merged
Conversation
This was referenced Jun 16, 2026
This was referenced Aug 31, 2026
This was referenced Sep 8, 2026
This was referenced Sep 17, 2026
This was referenced Sep 28, 2026
This was referenced Oct 5, 2026
This was referenced Oct 19, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
xunit.v3andUseMicrosoftTestingPlatformRunner, collapsing the per-areaXunit2/Xunit3.Directory.Build.propsbuild variants into a single set of props.test/Directory.Build.propsnow carries only common settings, while the xUnit v3 + MTP-runner harness moves to a siblingDirectory.Test.propsthat the ~126 runnable test projects import explicitly. Non-test fixtures (theTests.Utilitieshelpers,StarWars, the docs fixture, the Mocha helpers) no longer inherit the runner and declare only the deps they use, so they build as plain libraries instead of opting out of the harness.CancellationToken-accepting calls now passTestContext.Current.CancellationToken(over 7,600 call sites), so the suite stays clean underTreatWarningsAsErrors.UseCultureAttributeto theCookieCrumble.Xunit3snapshot adapter.ci.ymlandcoverage.yml:--coverage --coverage-output-format cobertura --report-trxinto per-project results directories, replacing the VSTest--collect/--logger trxcollector that doesn't run under the MTP runner.<IsPackable>false</IsPackable>now inherited from the shared props; drop the unusedxunitv2 metapackage and a temporaryxunit.analyzerspin fromDirectory.Packages.props; updateglobal.json.Test fixes
Running on xUnit v3 / MTP surfaced a set of latent test problems that VSTest/v2 had masked. None are product-behaviour regressions; each is a test-side fix, grouped by root cause:
Fusion.EventSources.Testsproject, and renamed theStarWarsschema-fixture project off the.Testssuffix so the name-based CI matrix stops invoking it as a test.IAsyncDisposableteardown that v2 skipped.CommandTestBase(Nitro CLI) moved toIAsyncLifetimeso its Strict-mockVerifyAllactually runs; the over-specified mock setups it then flagged were corrected via Run CommandTestBase teardown via IAsyncLifetime on xUnit v2 #9872, and the lifecycle is reconciled to v3'sValueTasksignatures here.SchemaCachenow keys onobjectType(sibling tests no longer share a resolver-less schema), and the SqlServer filter tests use a unique SQLite file per schema build (no cross-test database contamination). A Raven projection snapshot that had captured the pre-fix error was refreshed to the correct result.ActivityTestHelper(Diagnostics + Fusion) waits for span-export quiescence instead of racing the read.TaskCompletionSourceinstead of a blockingSpinWait.SpinUntil, which deadlocked awaited continuations on the v3 synchronization context.@defer/@streamsnapshot tests (StreamTests,DeferTests,DeferReferenceTests) capture an aggregated snapshot that is independent of incremental-vs-bundled delivery (a newMatchAggregatedSnapshot/MatchAggregatedMarkdownSnapshothelper). The one test that asserts the raw incremental structure (field dedup) is left raw, since its delivery is deterministic.SubscriptionEventTimeoutTestsawait the subscription teardown (MoveNextAsynccompleting) directly rather than a fixedTask.WhenAny(..., Task.Delay(...))race window that was too tight under load.CancellationTestscancels from within the running resolver rather than relying on a 150 ms wall-clock token.EvictSchemaTestspolls the endpoint until it serves the re-created schema instead of using fixed delays.OutputHelperusage-parsing regex ([\w]+→\S+).Test plan
net10.0and confirmed 0 xUnit1051 diagnostics across all test projects, and thatsrc/All.slnxbuilds clean after the opt-in restructure.Exetest hosts and run under MTP) while the 6 non-test fixtures build as libraries; ran Caching, Types.Tests, Language, and CookieCrumble.Tests to confirm the runner chain still works.*.cobertura.xml+*.trxmatching the artifact upload globs, with real coverage data and the test assembly excluded.Execution.Testsassembly across repeated runs to shake out the defer/stream delivery-timing flakes.