Repository navigation
Remove dead xUnit test-runner scaffolding after MSTest/MTP migration - #55093
Merged
Merged
Conversation
…nner plumbing All SDK test projects now run on MSTest.Sdk/MTP. This removes the remaining xUnit test-runner scaffolding that no longer has any consumer: - Re-point Microsoft.TemplateEngine.Cli.UnitTests from the legacy xUnit-coupled Microsoft.NET.TestFramework to its MSTest counterpart Microsoft.NET.TestFramework.MSTest. It was the last test project still referencing the legacy framework as a test dependency. - Remove the dead non-MSTest branches from test/Directory.Build.targets (TestRunnerName=XUnitV3, OutputType=Exe/NoDefaultExcludes, and the global 'using Xunit'). No non-MSTest test project remains to consume them; the NetAnalyzers tests that the stale comment referenced are now MSTest.Sdk. - Remove the now-unused XUnitDesktopSettingsFile/XUnitCoreSettingsFile properties from test/Directory.Build.props and delete test/xunit.runner.json (only referenced by those properties via eng/XUnitV3/XUnitV3.targets, which is selected by TestRunnerName=XUnitV3 and so no longer imported). Verified by building Microsoft.TemplateEngine.Cli.UnitTests, the NetAnalyzers UnitTests (which explicitly import test/Directory.Build.targets), and the legacy Microsoft.NET.TestFramework: all succeed with 0 warnings/0 errors. Co-authored-by: Copilot <[email protected]>
Arcade's Tests.targets imports $(RepositoryEngineeringDir)$(TestRunnerName)/$(TestRunnerName).targets only when a test project sets TestRunnerName=XUnitV3. That was set exclusively by the non-MSTest branch in test/Directory.Build.targets, which was removed once every SDK test project moved to MSTest.Sdk/MTP. No project sets TestRunnerName=XUnitV3 (or UseXUnitAotPackages) anymore, and nothing references eng/XUnitV3 by path, so XUnitV3.targets / XUnitV3.Runner.targets / xunit.runner.json are dead. Verified by building an MSTest.Sdk test project (dotnet-aot.Tests): Arcade skips the test-runner import (TestRunnerName is empty for UsingToolXUnit=false projects) and the build succeeds with 0 warnings / 0 errors. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes now-unused xUnit v3 test-runner scaffolding/configuration from the repo after the migration of SDK test projects to MSTest.Sdk / Microsoft.Testing.Platform, and repoints the last remaining test project that still referenced the legacy xUnit-coupled test framework.
Changes:
- Replaced
Microsoft.TemplateEngine.Cli.UnitTests’ reference toMicrosoft.NET.TestFrameworkwithMicrosoft.NET.TestFramework.MSTest. - Removed dead xUnit-specific properties/usings/runner selection logic from
test/Directory.Build.*and deletedtest/xunit.runner.json. - Deleted the orphaned
eng/XUnitV3/test-runner targets and associated runner config.
Show a summary per file
| File | Description |
|---|---|
| test/xunit.runner.json | Deletes unused xUnit runner configuration no longer referenced by test builds. |
| test/Microsoft.TemplateEngine.Cli.UnitTests/Microsoft.TemplateEngine.Cli.UnitTests.csproj | Switches test framework reference to the MSTest-specific framework project. |
| test/Directory.Build.targets | Removes dead xUnit runner selection and global Xunit using; keeps MSTest/AwesomeAssertions behavior. |
| test/Directory.Build.props | Removes now-unused xUnit runner settings file properties. |
| eng/XUnitV3/XUnitV3.targets | Deletes unused xUnit v3 runner/import target file. |
| eng/XUnitV3/XUnitV3.Runner.targets | Deletes unused xUnit runner execution target. |
| eng/XUnitV3/xunit.runner.json | Deletes unused xUnit runner config under eng/. |
Copilot's findings
- Files reviewed: 7/7 changed files
- Comments generated: 0
Evangelink
enabled auto-merge
July 1, 2026 10:21
YuliiaKovalova
approved these changes
Jul 1, 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
Now that every SDK test project runs on
MSTest.Sdk/ Microsoft.Testing.Platform, this PR removes the leftover xUnit test-runner scaffolding that no longer has any consumer. It is pure dead-code / dead-configuration removal — no behavior change.Changes
Re-point the last legacy-framework consumer —
Microsoft.TemplateEngine.Cli.UnitTestsnow referencesMicrosoft.NET.TestFramework.MSTestinstead of the xUnit-coupledMicrosoft.NET.TestFramework. It was the only remaining test project referencing the legacy framework as a test dependency, so no test project references the legacy framework anymore.Prune dead xUnit plumbing from
test/Directory.Build.*:Directory.Build.targets: removed theIsTestProject==true AND UsingMSTestSdk != truebranch (TestRunnerName=XUnitV3,OutputType=Exe/NoDefaultExcludes) and the globalusing Xunit. That condition now matches zero projects; the NetAnalyzers tests the stale comment referenced areMSTest.Sdk. Refreshed the surrounding comments.Directory.Build.props: removed the now-unusedXUnitDesktopSettingsFile/XUnitCoreSettingsFileproperties.test/xunit.runner.json(only reachable via those properties througheng/XUnitV3/XUnitV3.targets).Remove the orphaned
eng/XUnitV3/folder (XUnitV3.targets,XUnitV3.Runner.targets,xunit.runner.json). Arcade'sTests.targetsimportseng/$(TestRunnerName)/$(TestRunnerName).targetsonly when a project setsTestRunnerName=XUnitV3— set exclusively by the branch removed in (2). Nothing sets it (orUseXUnitAotPackages) anymore, and nothing references the folder by path.Verification
Built with the repo toolset — all 0 warnings / 0 errors:
Microsoft.TemplateEngine.Cli.UnitTests(the re-point)Microsoft.CodeAnalysis.NetAnalyzers.UnitTests(the one project that explicitly importstest/Directory.Build.targets)Microsoft.NET.TestFramework(legacy framework, no regression)dotnet-aot.Tests(MSTest.Sdk — confirms Arcade skips the test-runner import cleanly aftereng/XUnitV3/removal)Follow-up (intentionally not in this PR)
The live Helix work-item infrastructure (
test/xunit-runner/,SDKCustomXUnitProjectintest/UnitTests.proj, theHelixTasksSDKCustomCreateXUnitWorkItems…task) is now runner-agnostic but still carriesXUnitnaming. Renaming it touches a compiled MSBuild task and is validated only by a full Helix run, so it's tracked as a separate follow-up rather than mixed into this dead-code removal.