chore(deps): update xUnit.net v3 to 4.0

Aperta
#591 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp, github-actions

Direzione di ricerca

Start with root Directory.Packages.props, tests/Directory.Build.props, and .github/workflows/build-library.yml; check the xUnit 4 migration notes and the test runner configuration. Search for the listed ordering and parallelism APIs, then run dotnet restore, dotnet build, and dotnet test. Done means CI and coverage work, all tests remain discovered, and the deferred MTP migration has a follow-up issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

dependencies Infrastructure

Part 5 of the outdated-package sweep (dotnet-outdated 4.8.1, 2026-11-05). Major upgrade of the xUnit.net v3 framework.

Current state

Root Directory.Packages.props:

  • xunit.v3 3.2.2, xunit.v3.core 3.2.2, xunit.v3.assert 3.2.2 -> 4.0.2
  • xunit.runner.visualstudio 3.1.5 -> 4.0.1

tests/Directory.Build.props: test projects are OutputType=Exe, reference Microsoft.NET.Test.Sdk, xunit.v3, XUnit.Combinatorial, and xunit.runner.visualstudio; dotnet test runs via the VSTest host with coverlet / XPlat Code Coverage. xunit.v3.core and xunit.v3.assert are referenced by CommunityToolkit.Datasync.TestCommon.

Key breaking changes in 4.0.0 (https://xunit.net/releases/v3/4.0.0)

  • Microsoft Testing Platform v1 support dropped; MTP v2 is now the default. If CI/dotnet test prints "Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later", the repo's test runner config must be updated (see https://xunit.net/docs/getting-started/v3/microsoft-testing-platform and the "Testing with 'dotnet test'" doc). Two options: (a) stay on VSTest by using the xunit.v3.*.mtp-off package variants (e.g. xunit.v3.mtp-off instead of xunit.v3), or (b) move to MTP v2 and global.json test.runner settings. Prefer (a) first (smallest change; keeps coverlet/XPlat coverage and current CI commands), and file a follow-up issue for MTP migration.
  • Reporting switches renamed for MTP (-report-xunit -> -report-xunit-xml, etc.) and CTRF format changed. Check .github/workflows/build-library.yml and any scripts for use of these flags.
  • New class/method test orderers; test case ordering semantics changed. Search the tests for ITestCaseOrderer, TestCaseOrderer, CollectionBehavior, DisableTestParallelization, MaxParallelThreads.
  • Parallelism attributes: [assembly: CollectionBehavior] options for parallelism are obsolete/uncallable; use [assembly: Parallelization]. Check xunit.runner.json / testconfig.json too.
  • Mono unsupported (not relevant).
  • XUnit.Combinatorial 2.x works with 4.x (depends on xunit.v3.extensibility.core >= 1.0.0); confirm after the "update test tooling" PR.

Steps

  1. Create the branch. Bump all four packages in lockstep (versions must exist: check NuGet; use latest 4.0.x).
  2. Choose option (a) above; fix compile errors (extensibility/orderer/parallelism APIs).
  3. dotnet restore && dotnet build && dotnet test. Compare total/passed/skipped test counts against main before the change to prove no tests were silently dropped or not discovered.
  4. Verify the CI test summary + coverage output still work (TestResults/SummaryGithub.md, coverage upload) in .github/workflows/build-library.yml.
  5. Dispatch build-library.yml on the fork with --ref <branch>.
  6. Check CONTRIBUTING.md/docs for test-run instructions that need updating.

Acceptance criteria

  • xunit.v3 packages at 4.0.x and runner at 4.0.1; no test loss (document counts in the PR); CI green with coverage.
  • If MTP migration is deferred, a follow-up issue exists.
  • PR title: chore(deps): update xUnit.net v3 to 4.0.
Lingua principale
C#
Stelle
184
Fork
48
Merge medio
21m
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CommunityToolkit/Datasync

Tutte le issue di CommunityToolkit/Datasync

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.