Skip to content

CONFIG: Move The Test Projects To xunit 4 On The Microsoft Testing Platform - #45

Merged
morgang-adappt merged 1 commit into
mainfrom
users/perirrs/CONFIG-xunit-4-testing-platform
Oct 15, 2026
Merged

morgang-adappt merged 1 commit into
mainfrom
users/perirrs/CONFIG-xunit-4-testing-platform

Conversation

@perirrs

@perirrs perirrs commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Continues the test-platform wave on top of the ADotNet 6.0.0 sweep already on main.

What changes

  • All six test projects move from xunit 2.9.3 to xunit.v3 4.0.2, with
    xunit.runner.visualstudio 4.0.1 and Microsoft.NET.Test.Sdk 18.11.0.
  • global.json opts dotnet test into the Microsoft Testing Platform runner. The runner 4.x
    line no longer supports VSTest on the .NET 10 SDK, so the packages and global.json are
    coupled: neither builds nor runs tests alone. Once global.json selects the platform every
    test project in the repository must use it, so the projects move together.
  • The Microsoft.Extensions family goes to 10.0.13 as one coupled set.
  • FluentAssertions stays locked at [7.2.2].
  • The workflow test steps use the Microsoft Testing Platform form with --ignore-exit-code 8,
    which treats "zero tests ran" as a pass where VSTest only warned; a real failure still exits 2.
    Changed in the generator and regenerated, not hand-edited; running the generator twice produces
    identical files.
  • pages.yml runs no tests and needs no equivalent change.

Tests

Restore and build are clean (0 errors). All 298 tests pass across the six projects, run in the
same shape the workflow runs them.

closes AB#30046

…atform

Migrates all six test projects from xunit 2.9.3 to xunit.v3 4.0.2, with
xunit.runner.visualstudio 4.0.1 and Microsoft.NET.Test.Sdk 18.11.0, and opts the repo
into the Microsoft Testing Platform through global.json. The runner 4.x line no longer
supports VSTest on the .NET 10 SDK, so the package move and the global.json switch are
coupled: neither builds nor runs tests on its own. Once global.json selects the
platform, every test project must use it, so the projects had to move together.

Also brings the Microsoft.Extensions family to 10.0.13 as one coupled set.
FluentAssertions stays locked at [7.2.2].

The build workflow now runs tests in the Microsoft Testing Platform form. The platform
rejects a bare directory, so the three discovery loops pass each project with --project,
and --ignore-exit-code 8 treats "zero tests ran" as a pass where VSTest only warned; a
real failure still exits 2. The workflow was regenerated from the Infrastructure
generator, not hand-edited, and running the generator twice produces identical files.
pages.yml runs no tests and needs no equivalent change.

Tests: 298 across all six projects, all passing.
Copilot AI balanced review requested due to automatic review settings October 15, 2026 12:37
@github-actions github-actions Bot added the CONFIG The configuration category is for any configuration changes i.e. setting up appsettings.json label Oct 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The coupled runner and package migration needs human confirmation of SDK compatibility, test discovery, and CI failure propagation.

0 open findings

What changed in this PR

Migrates all six test projects to xunit.v3 4.0.2 and Microsoft Testing Platform, keeping generated CI commands aligned with the new runner.

Changes:

  • Updates test packages while preserving the FluentAssertions pin.
  • Selects Microsoft Testing Platform and updates workflow generation and test commands.
  • Aligns Microsoft.Extensions packages at 10.0.13.
File Description
NHSDigital.ApiPlatform.Sdk/​NHSDigital.ApiPlatform.Sdk.csproj Updates Microsoft.Extensions dependencies.
NHSDigital.ApiPlatform.Sdk.Tests.Unit/​NHSDigital.ApiPlatform.Sdk.Tests.Unit.csproj Migrates SDK unit-test packages.
NHSDigital.ApiPlatform.Sdk.Tests.Integration/​NHSDigital.ApiPlatform.Sdk.Tests.Integration.csproj Migrates test packages and updates configuration dependencies.
NHSDigital.ApiPlatform.Sdk.Tests.Acceptance/​NHSDigital.ApiPlatform.Sdk.Tests.Acceptance.csproj Migrates SDK acceptance-test packages.
NHSDigital.ApiPlatform.Sdk.AspNetCore.Tests.Unit/​NHSDigital.ApiPlatform.Sdk.AspNetCore.Tests.Unit.csproj Migrates ASP.NET Core unit-test packages.
NHSDigital.ApiPlatform.Sdk.AspNetCore.Tests.Integration/​NHSDigital.ApiPlatform.Sdk.AspNetCore.Tests.Integration.csproj Migrates test packages and updates configuration dependencies.
NHSDigital.ApiPlatform.Sdk.AspNetCore.Tests.Acceptance/​NHSDigital.ApiPlatform.Sdk.AspNetCore.Tests.Acceptance.csproj Migrates ASP.NET Core acceptance-test packages.
NHSDigital.ApiPlatform.Infrastructure/​Services/​ScriptGenerationService.cs Generates platform-compatible test commands.
global.json Selects Microsoft Testing Platform.
.github/​workflows/​build.yml Uses updated test commands and permits zero-test exits.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@perirrs
perirrs requested a review from cjdutoit October 15, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CONFIG The configuration category is for any configuration changes i.e. setting up appsettings.json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants