Repository navigation
Migrate tests to xUnit v3 and Microsoft.Testing.Platform - #6055
Conversation
Co-authored-by: Copilot <[email protected]> Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Co-authored-by: Copilot <[email protected]> Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Co-authored-by: Copilot <[email protected]> Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Co-authored-by: Copilot <[email protected]> Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Co-authored-by: Copilot <[email protected]> Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical skip behavior and concurrent output handling issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
This pull request migrates the test infrastructure from xUnit v2 to xUnit v3 and Microsoft.Testing.Platform, including skip handling, output helpers, cancellation, and project configuration.
Changes:
- Configures test projects as xUnit v3/MTP executables.
- Replaces custom skippable-test infrastructure.
- Updates output helpers and cancellation-aware test execution.
- Removes obsolete xUnit v2 dependencies.
Approval is blocked by conditional tests being unconditionally skipped, unsynchronized output buffers, and cancellation tokens captured during discovery.
| File | Description |
|---|---|
src/tests/SOS.UnitTests/xunit.runner.json |
Removes legacy runner configuration. |
src/tests/SOS.UnitTests/testconfig.json |
Adds xUnit v3 configuration. |
src/tests/SOS.UnitTests/SOSRunner.cs |
Updates skip APIs. |
src/tests/SOS.UnitTests/SOS.UnitTests.csproj |
Enables xUnit v3/MTP. |
src/tests/SOS.UnitTests/SOS.cs |
Migrates theories and skips. |
src/tests/Microsoft.SymbolStore.UnitTests/Tracer.cs |
Updates xUnit output APIs. |
src/tests/Microsoft.SymbolStore.UnitTests/SymbolStoreTests.cs |
Removes obsolete xUnit imports. |
src/tests/Microsoft.SymbolStore.UnitTests/PEFileKeyGenerationTests.cs |
Removes obsolete xUnit imports. |
src/tests/Microsoft.SymbolStore.UnitTests/Microsoft.SymbolStore.UnitTests.csproj |
Enables xUnit v3/MTP. |
src/tests/Microsoft.SymbolStore.UnitTests/KeyGeneratorTests.cs |
Removes obsolete xUnit imports. |
src/tests/Microsoft.FileFormats.UnitTests/Microsoft.FileFormats.UnitTests.csproj |
Enables xUnit v3/MTP. |
src/tests/Microsoft.Diagnostics.NETCore.Client/ReversedServerTests.cs |
Migrates theories and skips. |
src/tests/Microsoft.Diagnostics.NETCore.Client/PidIpcEndpointTests.cs |
Migrates conditional skips. |
src/tests/Microsoft.Diagnostics.NETCore.Client/PerfMapTests.cs |
Migrates theories and skips. |
src/tests/Microsoft.Diagnostics.NETCore.Client/Microsoft.Diagnostics.NETCore.Client.UnitTests.csproj |
Enables xUnit v3 and removes v2 extensions. |
src/tests/Microsoft.Diagnostics.NETCore.Client/HandleableCollectionTests.cs |
Adds cancellation support. |
src/tests/Microsoft.Diagnostics.NETCore.Client/GetPublishedProcessesTests.cs |
Migrates theories. |
src/tests/Microsoft.Diagnostics.NETCore.Client/GetProcessInfoTests.cs |
Migrates theories and skips. |
src/tests/Microsoft.Diagnostics.NETCore.Client/GetProcessEnvironmentTests.cs |
Migrates theories and skips. |
src/tests/Microsoft.Diagnostics.NETCore.Client/EventPipeSessionTests.cs |
Migrates theories and cancellation. |
src/tests/Microsoft.Diagnostics.Monitoring/PipelineTests.cs |
Updates cancellation-aware APIs. |
src/tests/Microsoft.Diagnostics.Monitoring/Microsoft.Diagnostics.Monitoring.UnitTests.csproj |
Enables xUnit v3/MTP. |
src/tests/Microsoft.Diagnostics.Monitoring.EventPipe/PipelineTestUtilities.cs |
Updates xUnit output APIs. |
src/tests/Microsoft.Diagnostics.Monitoring.EventPipe/Microsoft.Diagnostics.Monitoring.EventPipe.UnitTests.csproj |
Enables xUnit v3/MTP. |
src/tests/Microsoft.Diagnostics.Monitoring.EventPipe/LogsPipelineUnitTests.cs |
Migrates theories. |
src/tests/Microsoft.Diagnostics.Monitoring.EventPipe/GlobMatcherTests.cs |
Removes obsolete xUnit imports. |
src/tests/Microsoft.Diagnostics.Monitoring.EventPipe/EventTracePipelineUnitTests.cs |
Migrates theories. |
src/tests/Microsoft.Diagnostics.Monitoring.EventPipe/EventLogsPipelineUnitTests.cs |
Migrates theories and cancellation. |
src/tests/Microsoft.Diagnostics.Monitoring.EventPipe/EventCounterTriggerTests.cs |
Migrates skip handling. |
src/tests/Microsoft.Diagnostics.Monitoring.EventPipe/EventCounterPipelineUnitTests.cs |
Migrates theories and skips. |
src/tests/Microsoft.Diagnostics.Monitoring.EventPipe/DistributedTracesPipelineUnitTests.cs |
Migrates theories. |
src/tests/Microsoft.Diagnostics.Monitoring.EventPipe/AspNetTriggerUnitTests.cs |
Removes obsolete xUnit imports. |
src/tests/Microsoft.Diagnostics.ExtensionCommands.UnitTests/Microsoft.Diagnostics.ExtensionCommands.UnitTests.csproj |
Enables xUnit v3/MTP. |
src/tests/Microsoft.Diagnostics.DebugServices.UnitTests/RunTests.cs |
Updates output and skip handling. |
src/tests/Microsoft.Diagnostics.DebugServices.UnitTests/Microsoft.Diagnostics.DebugServices.UnitTests.csproj |
Enables xUnit v3/MTP. |
src/tests/Microsoft.Diagnostics.DebugServices.UnitTests/DebugServicesTests.cs |
Migrates theories and skips. |
src/tests/Microsoft.Diagnostics.DebugServices.UnitTests/CommandServiceTests.cs |
Migrates theories. |
src/tests/Microsoft.Diagnostics.DebugServices.UnitTests/ClrmaTests.cs |
Migrates theories and skips. |
src/tests/eventpipe/ThreadPoolEvents.cs |
Removes obsolete xUnit imports. |
src/tests/eventpipe/providers.cs |
Removes obsolete xUnit imports. |
src/tests/eventpipe/MethodEvents.cs |
Removes obsolete xUnit imports. |
src/tests/eventpipe/LoaderEvents.cs |
Removes obsolete xUnit imports. |
src/tests/eventpipe/GCEvents.cs |
Removes obsolete xUnit imports. |
src/tests/eventpipe/EventPipe.UnitTests.csproj |
Enables xUnit v3/MTP. |
src/tests/eventpipe/CustomEvents.cs |
Removes obsolete xUnit imports. |
src/tests/eventpipe/ContentionEvents.cs |
Removes obsolete xUnit imports. |
src/tests/eventpipe/common/RemoteTestExecutorHelper.cs |
Updates xUnit output APIs. |
src/tests/dotnet-trace/DotnetTrace.UnitTests.csproj |
Enables xUnit v3/MTP. |
src/tests/dotnet-trace/CollectLinuxCommandFunctionalTests.cs |
Adds cancellation-aware arguments. |
src/tests/dotnet-trace/CollectCommandFunctionalTests.cs |
Removes obsolete xUnit imports. |
src/tests/dotnet-trace/ChildProcessTests.cs |
Migrates theories and skips. |
src/tests/dotnet-stack/StackTests.cs |
Migrates theories. |
src/tests/dotnet-stack/DotnetStack.UnitTests.csproj |
Enables xUnit v3/MTP. |
src/tests/dotnet-counters/DotnetCounters.UnitTests.csproj |
Enables xUnit v3/MTP. |
src/tests/dotnet-counters/CounterMonitorPayloadTests.cs |
Migrates theories and skips. |
src/tests/dotnet-counters/ConsoleExporterTests.cs |
Removes obsolete xUnit imports. |
src/tests/DbgShim.UnitTests/DebuggeeInfo.cs |
Removes obsolete xUnit imports. |
src/tests/DbgShim.UnitTests/DbgShimTests.cs |
Migrates theories and skips. |
src/tests/DbgShim.UnitTests/DbgShim.UnitTests.csproj |
Enables xUnit v3/MTP. |
src/tests/CommonTestRunner/TestRunnerUtilities.cs |
Updates xUnit output APIs. |
src/tests/CommonTestRunner/TestRunner.cs |
Updates xUnit output APIs. |
src/tests/Common/MockConsole.cs |
Removes obsolete xUnit imports. |
src/Microsoft.Diagnostics.TestHelpers/Xunit.Extensions/SkipTestException.cs |
Removes obsolete skip exception. |
src/Microsoft.Diagnostics.TestHelpers/Xunit.Extensions/SkippableTheoryTestCase.cs |
Removes v2 theory infrastructure. |
src/Microsoft.Diagnostics.TestHelpers/Xunit.Extensions/SkippableTheoryDiscoverer.cs |
Removes v2 theory infrastructure. |
src/Microsoft.Diagnostics.TestHelpers/Xunit.Extensions/SkippableTheoryAttribute.cs |
Removes v2 theory infrastructure. |
src/Microsoft.Diagnostics.TestHelpers/Xunit.Extensions/SkippableFactTestCase.cs |
Removes v2 fact infrastructure. |
src/Microsoft.Diagnostics.TestHelpers/Xunit.Extensions/SkippableFactMessageBus.cs |
Removes v2 skip infrastructure. |
src/Microsoft.Diagnostics.TestHelpers/Xunit.Extensions/SkippableFactDiscoverer.cs |
Removes v2 fact infrastructure. |
src/Microsoft.Diagnostics.TestHelpers/Xunit.Extensions/SkippableFactAttribute.cs |
Removes v2 fact infrastructure. |
src/Microsoft.Diagnostics.TestHelpers/TestStep.cs |
Updates xUnit output APIs. |
src/Microsoft.Diagnostics.TestHelpers/TestRunner.cs |
Extends output helper APIs. |
src/Microsoft.Diagnostics.TestHelpers/TestOutputProcessLogger.cs |
Updates xUnit output APIs. |
src/Microsoft.Diagnostics.TestHelpers/TestConfiguration.cs |
Migrates skip handling. |
src/Microsoft.Diagnostics.TestHelpers/SdkPrebuiltDebuggeeCompiler.cs |
Updates xUnit output APIs. |
src/Microsoft.Diagnostics.TestHelpers/RemoteExecutorHelper.cs |
Updates xUnit APIs. |
src/Microsoft.Diagnostics.TestHelpers/ProcessRunner.cs |
Extends output helper APIs. |
src/Microsoft.Diagnostics.TestHelpers/PrebuiltDebuggeeCompiler.cs |
Updates xUnit output APIs. |
src/Microsoft.Diagnostics.TestHelpers/MultiplexTestOutputHelper.cs |
Extends output helper APIs. |
src/Microsoft.Diagnostics.TestHelpers/Microsoft.Diagnostics.TestHelpers.csproj |
Switches to xUnit v3 dependencies. |
src/Microsoft.Diagnostics.TestHelpers/LoggingListener.cs |
Updates xUnit output APIs. |
src/Microsoft.Diagnostics.TestHelpers/IndentedTestOutputHelper.cs |
Extends output helper APIs. |
src/Microsoft.Diagnostics.TestHelpers/FileTestOutputHelper.cs |
Adds captured output support. |
src/Microsoft.Diagnostics.TestHelpers/DotNetBuildDebuggeeTestStep.cs |
Updates xUnit output APIs. |
src/Microsoft.Diagnostics.TestHelpers/DebuggeeCompiler.cs |
Updates xUnit output APIs. |
src/Microsoft.Diagnostics.TestHelpers/CsprojBuildDebuggeeTestStep.cs |
Updates xUnit output APIs. |
src/Microsoft.Diagnostics.TestHelpers/ConsoleTestOutputHelper.cs |
Adds captured output support. |
src/Microsoft.Diagnostics.TestHelpers/ConditionalTestAttributes.cs |
Adds conditional xUnit v3 attributes. |
src/Microsoft.Diagnostics.TestHelpers/BaseDebuggeeCompiler.cs |
Updates xUnit output APIs. |
src/Microsoft.Diagnostics.TestHelpers/AssertX.cs |
Updates xUnit output APIs. |
src/Microsoft.Diagnostics.TestHelpers/AcquireDotNetTestStep.cs |
Updates xUnit output APIs. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
Does this then take over #5949? |
|
If it does - cherry pick the build script changes at least - there's also a couple others that make sense to port to avoid installing too many runtimes. |
Co-authored-by: Copilot <[email protected]> Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Co-authored-by: Juan Hoyos <[email protected]> Co-authored-by: Copilot <[email protected]> Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Co-authored-by: Copilot <[email protected]> Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Co-authored-by: Copilot <[email protected]> Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Limit xUnit result discovery to the primary reports in the active configuration directory so TRX attachment copies are not imported as additional test results. Co-authored-by: Copilot <[email protected]> Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3


Summary
Testing
Build.cmdpassesDotnetTrace.UnitTests: 108 passed, 36 skippedMicrosoft.Diagnostics.NETCore.Client.UnitTests: 146 passed, 18 skippedTest.cmdcompleted all migrated suites; local failures were limited to existing SOS source-line expectations and .NET 11 single-file DbgShim PE timestamp mismatches