Skip to content

Update xunit.v3 to 4.0.0 and enable full parallelization - #1285

Merged
meziantou merged 3 commits into
mainfrom
claude/xunit-v3-upgrade-4-0-0-7a7735
Aug 15, 2026
Merged

meziantou merged 3 commits into
mainfrom
claude/xunit-v3-upgrade-4-0-0-7a7735

Conversation

@meziantou

@meziantou meziantou commented Aug 15, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • Upgrade to xunit.v3 4.0.0 (xunit.analyzers 2.0.0 transitively) and Meziantou.NET.Sdk 1.0.143.
  • Enable xunit v3 4.0.0 full test parallelization (all tests run in parallel regardless of collections).

How

xunit.v3 4.0.0 drops the VSTest bridge and defaults to Microsoft Testing Platform (MTP) v2. On the .NET 10 SDK the old VSTest path for MTP is gone, so dotnet test (used by CI) needs the MTP mode.

Meziantou.NET.Sdk.Test 1.0.143 does the heavy lifting automatically for the test project:

  • Adds an implicit xunit.v3.mtp-v2 4.0.0 reference when no test framework is referenced.
  • Sets OutputType=Exe (MTP test projects must be executable) and the MTP runner.
  • Source-generates [assembly: Xunit.v3.Parallelization(Mode = Xunit.Sdk.ParallelMode.All)] for full parallelization.

As a result the test project needs no xunit package references, no OutputType, no UseMicrosoftTestingPlatform, and no manual parallelization attribute.

The only remaining manual bit is global.json, which opts dotnet test into MTP mode on the .NET 10 SDK:

"test": { "runner": "Microsoft.Testing.Platform" }

Notes for reviewers

  • The global.json edit is normally discouraged by AGENTS.md, but the test.runner opt-in is the only supported way to run these MTP tests via dotnet test on the .NET 10 SDK (and the SDK version bump also lives in global.json).
  • Local dev: under MTP, dotnet test --filter uses xunit's query filter language (/assembly/namespace/class/method), not the VSTest FullyQualifiedName~ syntax. CI runs unfiltered so it is unaffected.

Testing

  • Build: clean, 0 warnings (default Roslyn + roslyn4.2).
  • dotnet test full suite: 3605 passed, 0 failed, 0 skipped, with full parallelization enabled.

Upgrade xunit.v3 and xunit.runner.visualstudio to 4.0.0 (analyzers 2.0.0
comes in transitively).

xunit.v3 4.0.0 drops the VSTest bridge and defaults to Microsoft Testing
Platform (MTP) v2. On the .NET 10 SDK the old VSTest path for MTP is gone,
so a few adjustments are required to keep `dotnet test` working:

- global.json: opt into the MTP mode of `dotnet test`
  ("test": { "runner": "Microsoft.Testing.Platform" }).
- Test project: set OutputType=Exe (MTP test projects must be executable)
  and UseMicrosoftTestingPlatform=true so Meziantou.NET.Sdk.Test provisions
  the MTP extensions instead of Microsoft.NET.Test.Sdk.

Also enable xunit v3 4.0.0 full test parallelization via
[assembly: Parallelization(Mode = ParallelMode.All)].

All 3605 tests pass under `dotnet test`.
Meziantou.NET.Sdk.Test 1.0.143 handles the xunit v3 4.0.0 / MTP setup
automatically, so the manual configuration can be removed:

- Implicit xunit.v3.mtp-v2 4.0.0 reference when no test framework is
  referenced -> remove the explicit xunit.v3 / xunit.runner.visualstudio
  package references.
- OutputType=Exe and MTP runner are set by the SDK -> remove OutputType
  and UseMicrosoftTestingPlatform from the project.
- Full parallelization attribute is source-generated by the SDK
  ([assembly: Xunit.v3.Parallelization(Mode = ParallelMode.All)])
  -> remove the manual AssemblyInfo.cs.

The global.json "test.runner" MTP opt-in is kept.

All 3605 tests pass under `dotnet test`.
The NuGet package icon is now provided automatically by Meziantou.NET.Sdk
(it packs its own icon.png as PackageIcon for Meziantou projects). The
repository-root icon.png is byte-identical to the SDK's and is not
referenced by any project or file, so it is redundant.
@meziantou
meziantou merged commit a64ef7b into main Aug 15, 2026
11 checks passed
@meziantou
meziantou deleted the claude/xunit-v3-upgrade-4-0-0-7a7735 branch August 15, 2026 19:15
IhateTrains pushed a commit to ParadoxGameConverters/ImperatorToCK3 that referenced this pull request Aug 16, 2026
Updated
[Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer)
from 3.0.151 to 3.0.157.

<details>
<summary>Release notes</summary>

_Sourced from [Meziantou.Analyzer's
releases](https://github.com/meziantou/Meziantou.Analyzer/releases)._

## 3.0.157

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.157>

## What's Changed
* Update xunit.v3 to 4.0.0 and enable full parallelization by
@​meziantou in meziantou/Meziantou.Analyzer#1285


**Full Changelog**:
meziantou/Meziantou.Analyzer@3.0.156...3.0.157

## 3.0.156

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.156>

## What's Changed
* Add MA0214/MA0215 for await vs. return-task style by @​meziantou in
meziantou/Meziantou.Analyzer#1282


**Full Changelog**:
meziantou/Meziantou.Analyzer@3.0.155...3.0.156

## 3.0.155

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.155>

## What's Changed
* Add MA0002.report_only_non_ordinal option by @​meziantou in
meziantou/Meziantou.Analyzer#1283


**Full Changelog**:
meziantou/Meziantou.Analyzer@3.0.154...3.0.155

## 3.0.154

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.154>

## What's Changed
* chore(deps): update all dependencies by @​renovate[bot] in
meziantou/Meziantou.Analyzer#1261


**Full Changelog**:
meziantou/Meziantou.Analyzer@3.0.153...3.0.154

## 3.0.153

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.153>

## What's Changed
* Exclude Meziantou assertions from string comparison analyzers by
@​meziantou in meziantou/Meziantou.Analyzer#1281


**Full Changelog**:
meziantou/Meziantou.Analyzer@3.0.152...3.0.153

## 3.0.152

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.152>

## What's Changed
* Exclude HRESULT.ThrowOnFailure from MA0060 diagnostics by @​meziantou
in meziantou/Meziantou.Analyzer#1279


**Full Changelog**:
meziantou/Meziantou.Analyzer@3.0.151...3.0.152

Commits viewable in [compare
view](meziantou/Meziantou.Analyzer@3.0.151...3.0.157).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Meziantou.Analyzer&package-manager=nuget&previous-version=3.0.151&new-version=3.0.157)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced Sep 14, 2026
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