Skip to content

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

Open
perirrs wants to merge 2 commits into
mainfrom
users/perirrs/CONFIG-xunit-4-testing-platform
Open

perirrs wants to merge 2 commits into
mainfrom
users/perirrs/CONFIG-xunit-4-testing-platform

Conversation

@perirrs

@perirrs perirrs commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Moves all three test projects to xunit.v3 4.0.0 and xunit.runner.visualstudio 4.0.0, as agreed with Christo: upgrade as we go so there is no big gap at the .NET 11 move in November. Follows LondonDataServices.FHIR PR #183.

What changes

  • xunit.v3 and xunit.runner.visualstudio 3 to 4 in all three test projects; Microsoft.NET.Test.Sdk aligned on 18.9.0. xunit.analyzers moves to 2.0.0 because xunit.v3 4.0.0 depends on it and the explicit 1.27.0 reference would be a downgrade (NU1605).
  • global.json opts dotnet test into the Microsoft Testing Platform runner. xunit 4 no longer supports VSTest on the .NET 10 SDK.
  • The build workflow's Test step names the solution with --solution and passes --ignore-exit-code 8. The platform rejects the bare dotnet test form, and returns 8 when a project has no tests where VSTest only warned. Changed in the generator (ScriptGenerationService) and regenerated.

Tests

Restore, build (0 errors) and the test run locally in the same shape as the workflow: Unit 29 passed, Acceptance 9 passed, 38 in total through --solution, the same counts as on main. Tests.Integration is not built in Debug by the solution, so --solution leaves it out exactly as the old command did; it still compiles on xunit 4.

Commits

One CONFIG commit for the packages and global.json (coupled: neither builds and tests alone), one CODE RUB commit for the workflow.

Supersedes Dependabot PRs #61, #62 and #63, which bump one package at a time.

Closes AB#30527.

…atform

xunit.v3 4.0.0 and xunit.runner.visualstudio 4.0.0 drop VSTest on the .NET 10 SDK, so
global.json opts dotnet test into the Microsoft Testing Platform runner. The package
bumps and global.json are coupled: neither builds and tests on its own. All three test
projects move together; xunit.analyzers moves to 2.0.0 because xunit.v3 4.0.0 depends on
it and the explicit 1.27.0 reference would be a downgrade (NU1605), and
Microsoft.NET.Test.Sdk aligned on 18.9.0. Replaces Dependabot PRs 61, 62 and 63.
…rkflow

The Microsoft Testing Platform rejects the bare dotnet test form, so the Test step names
the solution with --solution; locally that runs the Unit (29) and Acceptance (9) projects,
and Tests.Integration stays out because the solution does not build it in Debug.
--ignore-exit-code 8 treats "zero tests ran" as a pass, where VSTest only warned; a real
failure still exits 2. build.yml regenerated from the Infrastructure generator.
Copilot AI lite review requested due to automatic review settings September 17, 2026 19:07

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.

🟢 Approval recommended

All reviewed changes are addressed and no unresolved blocking issues remain.

Pull request overview

Upgrades the test projects to xUnit 4 and enables Microsoft Testing Platform for local and CI test execution.

Changes:

  • Updates test dependencies across all three projects.
  • Configures Microsoft Testing Platform via global.json.
  • Updates generated and committed CI test commands to use the solution.
File summaries
File Description
NHSISL.CsvHelperClient.Tests.Unit/NHSISL.CsvHelperClient.Tests.Unit.csproj Updates unit-test packages
NHSISL.CsvHelperClient.Tests.Integration/NHSISL.CsvHelperClient.Tests.Integration.csproj Updates integration-test packages
NHSISL.CsvHelperClient.Tests.Acceptance/NHSISL.CsvHelperClient.Tests.Acceptance.csproj Updates acceptance-test packages
NHSISL.CsvHelperClient.Infrastructure/Services/ScriptGenerationService.cs Updates generated test commands
global.json Selects Microsoft Testing Platform
.github/workflows/build.yml Runs solution-based tests in CI
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants