From 24392bc0746381f2d2a2cd94f9672d71f713291c Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Tue, 15 Sep 2026 16:30:21 +0200 Subject: [PATCH] fix(tests): opt the scaffold into Microsoft.Testing.Platform xUnit v3 4.x needs Microsoft.Testing.Platform on the .NET 10 SDK, which refuses the VSTest bridge, so a freshly generated project failed its first dotnet test. global.json now opts into that runner and the test project references the code coverage extension, so plain dotnet test passes and the shared run-dotnet-tests workflow collects Cobertura coverage once it supports the runner. Fixes #422. Co-Authored-By: Claude Opus 5 (1M context) --- AGENTS.md | 2 +- global.json | 3 +++ tests/Example.Tests/Example.Tests.csproj | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 23c244e..aeda7b6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,7 +8,7 @@ - `Example.slnx` — XML-based solution referencing the `src/` and `tests/` projects. - `src/Example/` — the library project (`Example.csproj`) with `ExampleClass.cs` and `FeatureFlags.cs` (the OpenFeature feature-flag scaffold; see *Feature flags*). -- `tests/Example.Tests/` — xUnit test project (`Example.Tests.csproj`, `ExampleClassTests.cs`) using `Microsoft.NET.Test.Sdk`, `coverlet.collector`, and `xunit.runner.visualstudio`. +- `tests/Example.Tests/` — xUnit v3 test project (`Example.Tests.csproj`, `ExampleClassTests.cs`). It runs on Microsoft.Testing.Platform: xUnit v3 4.x needs that runner on the .NET 10 SDK, and `global.json` opts in with `"test": { "runner": "Microsoft.Testing.Platform" }`. It references `Microsoft.Testing.Extensions.CodeCoverage`, so the shared `run-dotnet-tests` workflow collects Cobertura coverage. - `AGENTS.md` — the canonical, cross-tool project instructions. - `CLAUDE.md` / `GEMINI.md` — exact one-line `@AGENTS.md` shims; never copy guidance into them. - `.editorconfig` — formatting and analyzer rules enforced at build. diff --git a/global.json b/global.json index 34cc7a1..a9f688f 100644 --- a/global.json +++ b/global.json @@ -2,5 +2,8 @@ "sdk": { "version": "10.0.300", "rollForward": "latestFeature" + }, + "test": { + "runner": "Microsoft.Testing.Platform" } } diff --git a/tests/Example.Tests/Example.Tests.csproj b/tests/Example.Tests/Example.Tests.csproj index f4ee4a9..0e6107c 100644 --- a/tests/Example.Tests/Example.Tests.csproj +++ b/tests/Example.Tests/Example.Tests.csproj @@ -17,6 +17,7 @@ +