From ae19b97cfc864a8074f0bcaaa4d69e6ed8aeba04 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Sat, 29 Aug 2026 10:10:05 -0700 Subject: [PATCH 1/2] Migrate dotnet test to Microsoft.Testing.Platform for xunit.v3 4.0 xunit.v3 4.0.0 pulls in Microsoft.Testing.Platform.MSBuild, and the .NET 10 SDK refuses to run it under the VSTest 'dotnet test' target: 'Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later.' This is what's failing CI on the nuget-deps dependabot PRs (#323, #324), which propose this same xunit.v3 bump. Add global.json to opt dotnet test into native MTP mode (the SDK's recommended path over the legacy TestingPlatformDotnetTestSupport VSTest bridge, which Microsoft says MTP v2 drops for .NET 10). Drop xunit.runner.visualstudio, the now-unneeded VSTest adapter. Swap coverlet.collector for coverlet.MTP, since the VSTest coverlet data collector is silently ignored under MTP (MTP0001); update the CI unit-test step from --collect:"XPlat Code Coverage" to --coverlet --coverlet-output-format cobertura, which still lands Cobertura XML at ./coverage for the existing Codecov upload step. Also applies the other package bumps #323/#324 propose (AwesomeAssertions, Microsoft.CodeAnalysis.CSharp, Microsoft.NET.Test.Sdk, xunit.analyzers) so those PRs become no-ops once this merges. Verified locally: dotnet test passes 310/310 and produces Cobertura output at ./coverage; csharpier check, dotnet format style, the offline codegen-drift regenerate, and editorconfig-checker are all clean. --- .github/workflows/validate-task.yml | 6 ++++-- Directory.Packages.props | 15 ++++++++------- LanguageTagsTests/LanguageTagsTests.csproj | 9 ++++----- global.json | 5 +++++ 4 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 global.json diff --git a/.github/workflows/validate-task.yml b/.github/workflows/validate-task.yml index 33062ea..28a65d4 100644 --- a/.github/workflows/validate-task.yml +++ b/.github/workflows/validate-task.yml @@ -24,9 +24,11 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 # Builds with TreatWarningsAsErrors, so analyzer and code-style warnings fail here. - # --collect drives coverlet.collector to emit Cobertura XML into ./coverage//. + # global.json opts dotnet test into Microsoft.Testing.Platform (MTP) mode, the .NET 10 SDK's + # replacement for the VSTest runner; --coverlet drives coverlet.MTP (coverlet.collector's + # VSTest data collector is silently ignored under MTP) to emit Cobertura XML into ./coverage/. - name: Run unit tests step - run: dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage + run: dotnet test --coverlet --coverlet-output-format cobertura --results-directory ./coverage # Report-only: fail_ci_if_error is false so a Codecov hiccup or an absent token never fails the gate. - name: Upload coverage to Codecov step diff --git a/Directory.Packages.props b/Directory.Packages.props index f8074c3..8aa51c4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,10 +1,12 @@ - - - + + + + - + @@ -13,8 +15,7 @@ - - - + + diff --git a/LanguageTagsTests/LanguageTagsTests.csproj b/LanguageTagsTests/LanguageTagsTests.csproj index 544a84d..672ea99 100644 --- a/LanguageTagsTests/LanguageTagsTests.csproj +++ b/LanguageTagsTests/LanguageTagsTests.csproj @@ -11,12 +11,11 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + diff --git a/global.json b/global.json new file mode 100644 index 0000000..7ec050f --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +} From 509fa01e66ba0c27972b5c3a0b1d60288c4e5928 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Sat, 29 Aug 2026 10:20:04 -0700 Subject: [PATCH 2/2] Fix review findings on the MTP comment wrap and PrivateAssets claim Copilot: the coverlet.MTP comment attributed compile-time-closure inclusion to PrivateAssets; that's IncludeAssets (specifically not excluding "compile"), PrivateAssets only controls exposure to downstream consumers. Corrected, and noted this test project has none. Qodo: the new MTP comment in validate-task.yml wrapped narrower than the file's prevailing width. Reflowed to match. --- .github/workflows/validate-task.yml | 6 +++--- LanguageTagsTests/LanguageTagsTests.csproj | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate-task.yml b/.github/workflows/validate-task.yml index 28a65d4..af67422 100644 --- a/.github/workflows/validate-task.yml +++ b/.github/workflows/validate-task.yml @@ -24,9 +24,9 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 # Builds with TreatWarningsAsErrors, so analyzer and code-style warnings fail here. - # global.json opts dotnet test into Microsoft.Testing.Platform (MTP) mode, the .NET 10 SDK's - # replacement for the VSTest runner; --coverlet drives coverlet.MTP (coverlet.collector's - # VSTest data collector is silently ignored under MTP) to emit Cobertura XML into ./coverage/. + # global.json opts dotnet test into Microsoft.Testing.Platform (MTP) mode, the .NET 10 SDK's replacement for + # the VSTest runner; --coverlet drives coverlet.MTP (coverlet.collector's VSTest data collector is silently + # ignored under MTP) to emit Cobertura XML into ./coverage/. - name: Run unit tests step run: dotnet test --coverlet --coverlet-output-format cobertura --results-directory ./coverage diff --git a/LanguageTagsTests/LanguageTagsTests.csproj b/LanguageTagsTests/LanguageTagsTests.csproj index 672ea99..1c44906 100644 --- a/LanguageTagsTests/LanguageTagsTests.csproj +++ b/LanguageTagsTests/LanguageTagsTests.csproj @@ -13,8 +13,12 @@ + like the VSTest coverlet.collector was: its self-registration codegen needs the package on + this project's own compile-time closure, so IncludeAssets must not exclude "compile" (the + collector's restricted list omitted it, which is fine for a VSTest data collector but + breaks a compiled-against library). PrivateAssets is unrelated to that and stays unset, + since it only controls exposure to downstream consumers, which this test project has none + of. -->