Skip to content

Move the test project from xUnit v2 to xUnit v3 - #11

Merged
Prengemann merged 1 commit into
mainfrom
tests/xunit-v3
Nov 13, 2026
Merged

Prengemann merged 1 commit into
mainfrom
tests/xunit-v3

Conversation

@Prengemann

@Prengemann Prengemann commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Why

xunit 2.9.3 is the last v2 release. Since 2026-04-10 it and its four sub-packages (xunit.core, xunit.assert, xunit.extensibility.core, xunit.extensibility.execution) are deprecated on nuget.org as Legacy, with xunit.v3 as the successor. They only get security fixes. Only the test project is affected, not the shipped app.

Changes

EvenBetterFastSim.Tests/EvenBetterFastSim.Tests.csproj:

  • xunit 2.9.3 → xunit.v3.mtp-off 4.0.3. This is the VSTest variant of the official xunit3 template (Microsoft.NET.Test.Sdk + xunit.runner.visualstudio + xunit.v3.mtp-off). dotnet test, the commands in CLAUDE.md/AGENTS.md, CI and the Visual Studio Test Explorer keep working unchanged.
    • Not plain xunit.v3: in 4.x it pulls in Microsoft Testing Platform v2, and dotnet test on the .NET 10 SDK then fails with "Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later" unless a global.json opts into MTP. Reproduced locally. A comment in the csproj records this.
  • <OutputType>Exe</OutputType>: v3 runs the tests in their own process, started from the app host EvenBetterFastSim.Tests.exe. The xUnit v3 build targets require an executable.
  • Microsoft.NET.Test.Sdk 18.10.0 → 18.12.0 and xunit.runner.visualstudio 4.0.0 → 4.0.1: the template's pairing, both the newest stable versions.
  • xunit.analyzers now resolves to 2.3.0 (was 1.18.0). No new warnings.

CLAUDE.md, AGENTS.md: one sentence each saying xUnit v3 and why mtp-off.

The test code needs no change. It uses only [Fact] and Assert.*. Default parallelization (collections) and the use of AppContext.BaseDirectory behave the same in v3.

Verification

  • Linux SDK 10.0.404, Release build of the app and the test project: 0 warnings, 0 errors.
  • Tests under Wine with Windows .NET 10.0.14 (VSTest 18.7.0, xUnit.net VSTest Adapter 4.0.1): 7/7 pass. --filter "FullyQualifiedName~…" still works.
  • A deliberately failing temporary test fails the run (exit 1). A missing app host also fails the run ("Catastrophic failure"), so a v3 launch problem cannot pass silently with 0 tests.
  • dotnet list … package --deprecated --include-transitive and --vulnerable --include-transitive: nothing reported for the test project.
  • An independent review covered the migration, CI/release integration and local tooling, and a second agent tried to refute each finding. No blocking findings. release.yml publishes only the app project, so OutputType Exe on the test project does not touch the exe or the zip.
  • Not run on Windows yet: the CI run of this PR (windows-latest) is the first check there.

Merge

  • A squash merge to main triggers release.yml and publishes the next prerelease (v1.0.0-build.4 if this lands next).
  • Update Microsoft.Extensions to 10.0.15 and SourceLink to 10.0.404 #10 (package updates) also edits the test csproj, but only the SourceLink Update line. git merge-tree of both heads is clean in either order, and the result keeps xunit.v3.mtp-off 4.0.3 with SourceLink 10.0.404.

Internal board (secsgem/evencoolerfastsim): fixes issue 4.

🤖 Generated with Claude Code

xunit 2.9.3 and its four sub-packages are deprecated on nuget.org
(Legacy, successor xunit.v3) and only get security fixes.

- Replace xunit 2.9.3 with xunit.v3.mtp-off 4.0.3, the VSTest variant
  of the xunit3 template: dotnet test, CI and Test Explorer keep working
  unchanged. Plain xunit.v3 brings Microsoft Testing Platform v2, and
  dotnet test on the .NET 10 SDK then fails in VSTest mode unless a
  global.json opts into MTP.
- Set OutputType Exe: v3 runs the tests in their own process, started
  from the app host EvenBetterFastSim.Tests.exe.
- Bump Microsoft.NET.Test.Sdk 18.10.0 -> 18.12.0 and
  xunit.runner.visualstudio 4.0.0 -> 4.0.1 (the template pairing).
- CLAUDE.md, AGENTS.md: say xUnit v3 and why mtp-off.

The test code needs no change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Prengemann
Prengemann merged commit 75000c9 into main Nov 13, 2026
1 check passed
@Prengemann
Prengemann deleted the tests/xunit-v3 branch November 13, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant