Repository navigation
Migrate tests to xunit.v3 4.x on Microsoft Testing Platform v2 - #154
Conversation
Motivation ---------- xunit.v3 4.x uses Microsoft Testing Platform (MTP) v2 by default, so the VSTest adapter, test SDK, and VSTest loggers are no longer needed. Modifications ------------- - Update xunit.v3 to 4.0.3 and remove Microsoft.NET.Test.Sdk, xunit.runner.visualstudio, coverlet.collector, and JUnitTestLogger - Collect coverage with coverlet.MTP and report to GitHub Actions with GitHubActionsTestLogger 3.x (.NET targets only; no .NET Framework build) - Opt dotnet test into MTP mode in global.json - Resolve xUnit1069 by running the synchronous MalformedFrameInput copy on a worker thread with the test cancellation token - Update the build workflow for MTP command-line options, the new results directory, and forward-slash paths in net48 coverage files; drop the VSTest arm64 workaround and DisableAppDomain setting Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Passing tests do not establish bounded xUnit/MTP runner shutdown for the uncancellable synchronous worker’s intentional-hang case, which still requires runtime validation on .NET and net48.
No open issues 🎉
What changed in this PR
Migrates Snappier’s test suite from VSTest to xunit.v3 4.x on Microsoft Testing Platform v2, updating CI coverage and reporting.
Changes:
- Replace VSTest dependencies with MTP-compatible coverage and reporting packages.
- Update CI test commands, coverage artifact paths, and Windows path normalization.
- Make the malformed-frame regression test async while preserving synchronous decompression on a worker thread.
| File | Description |
|---|---|
Snappier.Tests/SnappyStreamTests.cs |
Adapt the malformed-frame timeout test for xUnit 4. |
Snappier.Tests/Snappier.Tests.csproj |
Upgrade xUnit and replace test tooling with MTP-compatible packages. |
global.json |
Select Microsoft Testing Platform for dotnet test. |
.github/workflows/main.yml |
Update test invocation, reporting, and coverage handling across platforms. |
Review effort: Balanced
|
Re: bounded runner shutdown when the Validated at runtime with a temporary test using the same pattern (
The orphaned spin runs on a thread-pool (background) thread, which does not keep the process alive, so MTP shuts down normally on both runtimes. The temporary test was not committed. No change needed. |
Motivation ---------- GitHubActionsTestLogger has no .NET Framework build, so the Windows net48 jobs no longer reported test results anywhere. Modifications ------------- Generate a TRX report with the reporter built into xunit.v3 and upload it as a test-results-net4-<arch> artifact, even when the test step fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Updated [Snappier](https://github.com/brantburnett/Snappier) from 1.3.1 to 1.3.2. <details> <summary>Release notes</summary> _Sourced from [Snappier's releases](https://github.com/brantburnett/Snappier/releases)._ ## 1.3.2 ## What's Changed * Support fork pull requests in build workflow by @brantburnett in brantburnett/Snappier#151 * Build with the .NET 11 SDK and C# 15 by @brantburnett in brantburnett/Snappier#153 * Migrate tests to xunit.v3 4.x on Microsoft Testing Platform v2 by @brantburnett in brantburnett/Snappier#154 * Fix literal overrun validation in Snappy decompression by @brantburnett in brantburnett/Snappier#156 * Enable C# 15 memory safety rules and annotate unsafe code by @brantburnett in brantburnett/Snappier#157 * Keep memory safety rules out of BenchmarkDotNet's generated project by @brantburnett in brantburnett/Snappier#160 * Use unaligned loads and stores in UnalignedCopy64/128 by @brantburnett in brantburnett/Snappier#159 * Move hot-path exception messages into NoInlining throw helpers by @brantburnett in brantburnett/Snappier#158 * Upgrade BenchmarkDotNet to 0.16.0-preview.2 and benchmark .NET 11 by @brantburnett in brantburnett/Snappier#161 * Compare buffer distances instead of forming out-of-range refs by @brantburnett in brantburnett/Snappier#162 * Reject undersized data chunks in framed stream decompression by @brantburnett in brantburnett/Snappier#163 * Use five launches for Default benchmark jobs by @brantburnett in brantburnett/Snappier#164 * Keep rare decompression paths out of the hot loop under Dynamic PGO by @brantburnett in brantburnett/Snappier#165 **Full Changelog**: brantburnett/Snappier@release/1.3.1...release/1.3.2 Commits viewable in [compare view](brantburnett/Snappier@release/1.3.1...release/1.3.2). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updated [coverlet.collector](https://github.com/coverlet-coverage/coverlet) from 10.1.0 to 10.1.1. <details> <summary>Release notes</summary> _Sourced from [coverlet.collector's releases](https://github.com/coverlet-coverage/coverlet/releases)._ ## 10.1.1 ### Improvements - Add `IsReachable` to branch points, computed from the method's control-flow graph, and exclude unreachable branches from branch-coverage totals and from branch details in Cobertura, LCOV and OpenCover reports [#2056](coverlet-coverage/coverlet#2056) by @pcshrosbree - coverlet.MTP: Narrow Dynamic Exclude Filters for Loaded Assemblies [#2069](coverlet-coverage/coverlet#2069) ### Fixed - Fix Regression Prevent invalid IL from branch trampolines [#2067](coverlet-coverage/coverlet#2067) - Fix Regression coverlet.MTP does not instrument local functions [#2046](coverlet-coverage/coverlet#2046) ## Maintenance - Update NuGet package versions [#2050](coverlet-coverage/coverlet#2050) [Diff between 10.1.0 and 10.1.1](coverlet-coverage/coverlet@v10.1.0...v10.1.1) Commits viewable in [compare view](coverlet-coverage/coverlet@v10.1.0...v10.1.1). </details> Updated [Microsoft.CodeAnalysis.Analyzers](https://github.com/dotnet/roslyn) from 5.9.0 to 5.12.0. <details> <summary>Release notes</summary> _Sourced from [Microsoft.CodeAnalysis.Analyzers's releases](https://github.com/dotnet/roslyn/releases)._ No release notes found for this version range. Commits viewable in [compare view](https://github.com/dotnet/roslyn/commits). </details> Updated Microsoft.CodeAnalysis.CSharp from 4.14.0 to 5.12.0. Updated [Snappier](https://github.com/brantburnett/Snappier) from 1.3.1 to 1.3.2. <details> <summary>Release notes</summary> _Sourced from [Snappier's releases](https://github.com/brantburnett/Snappier/releases)._ ## 1.3.2 ## What's Changed * Support fork pull requests in build workflow by @brantburnett in brantburnett/Snappier#151 * Build with the .NET 11 SDK and C# 15 by @brantburnett in brantburnett/Snappier#153 * Migrate tests to xunit.v3 4.x on Microsoft Testing Platform v2 by @brantburnett in brantburnett/Snappier#154 * Fix literal overrun validation in Snappy decompression by @brantburnett in brantburnett/Snappier#156 * Enable C# 15 memory safety rules and annotate unsafe code by @brantburnett in brantburnett/Snappier#157 * Keep memory safety rules out of BenchmarkDotNet's generated project by @brantburnett in brantburnett/Snappier#160 * Use unaligned loads and stores in UnalignedCopy64/128 by @brantburnett in brantburnett/Snappier#159 * Move hot-path exception messages into NoInlining throw helpers by @brantburnett in brantburnett/Snappier#158 * Upgrade BenchmarkDotNet to 0.16.0-preview.2 and benchmark .NET 11 by @brantburnett in brantburnett/Snappier#161 * Compare buffer distances instead of forming out-of-range refs by @brantburnett in brantburnett/Snappier#162 * Reject undersized data chunks in framed stream decompression by @brantburnett in brantburnett/Snappier#163 * Use five launches for Default benchmark jobs by @brantburnett in brantburnett/Snappier#164 * Keep rare decompression paths out of the hot loop under Dynamic PGO by @brantburnett in brantburnett/Snappier#165 **Full Changelog**: brantburnett/Snappier@release/1.3.1...release/1.3.2 Commits viewable in [compare view](brantburnett/Snappier@release/1.3.1...release/1.3.2). </details> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Motivation
xunit.v3 4.x uses Microsoft Testing Platform (MTP) v2 by default, so the VSTest adapter, test SDK, and VSTest loggers are no longer needed.
Modifications
xunit.v3to 4.0.3 (pulls inxunit.v3.mtp-v2) and removeMicrosoft.NET.Test.Sdk,xunit.runner.visualstudio,coverlet.collector, andJUnitTestLoggercoverlet.MTP10.1.0 (Cobertura output, same format as before)GitHubActionsTestLogger3.0.5, which supports MTP. It has no .NET Framework build, so it is referenced for .NET targets onlydotnet testinto MTP mode inglobal.json("test": { "runner": "Microsoft.Testing.Platform" }), required by the .NET 10+ SDKMalformedFrameInput: the test is now async and runs the synchronousCopyToon a worker thread withTestContext.Current.CancellationToken, so the timeout ends the test even if a regression causes a hang inside a singleReadcall. It still exercises the synchronous path--logger/--collectwith--report-github --coverlet --coverlet-output-format cobertura --results-directory "${{ github.workspace }}/TestResults"and update the coverage upload pathsVSTEST_DISABLE_ARTIFACTS_DIRECTORY_VERIFICATIONarm64 workaround--project Snappier.Testsbecause MTP-modedotnet testrejects--runtimeon a solution (NETSDK1134); dropRunConfiguration.DisableAppDomain; no--report-githubsince the reporter has no net48 build; instead, xunit.v3's built-in TRX reporter writesSnappier.Tests-net48-<arch>.trx, uploaded as thetest-results-net4-<arch>artifact (also on test failure)sedrewrite now matches either slashReviewer notes
test-results-net4-<arch>TRX artifacts.🤖 Generated with Claude Code