Skip to content

Migrate tests to xunit.v3 4.x on Microsoft Testing Platform v2 - #154

Merged
brantburnett merged 2 commits into
mainfrom
claude/migrate-xunit-v3-4x-d6fb65
Nov 13, 2026
Merged

brantburnett merged 2 commits into
mainfrom
claude/migrate-xunit-v3-4x-d6fb65

Conversation

@brantburnett

@brantburnett brantburnett commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

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 (pulls in xunit.v3.mtp-v2) and remove Microsoft.NET.Test.Sdk, xunit.runner.visualstudio, coverlet.collector, and JUnitTestLogger
  • Collect coverage with coverlet.MTP 10.1.0 (Cobertura output, same format as before)
  • Report results to GitHub Actions with GitHubActionsTestLogger 3.0.5, which supports MTP. It has no .NET Framework build, so it is referenced for .NET targets only
  • Opt dotnet test into MTP mode in global.json ("test": { "runner": "Microsoft.Testing.Platform" }), required by the .NET 10+ SDK
  • Resolve xUnit1069 on MalformedFrameInput: the test is now async and runs the synchronous CopyTo on a worker thread with TestContext.Current.CancellationToken, so the timeout ends the test even if a regression causes a hang inside a single Read call. It still exercises the synchronous path
  • Build workflow:
    • Replace --logger/--collect with --report-github --coverlet --coverlet-output-format cobertura --results-directory "${{ github.workspace }}/TestResults" and update the coverage upload paths
    • Remove the VSTEST_DISABLE_ARTIFACTS_DIRECTORY_VERIFICATION arm64 workaround
    • Windows job: target --project Snappier.Tests because MTP-mode dotnet test rejects --runtime on a solution (NETSDK1134); drop RunConfiguration.DisableAppDomain; no --report-github since the reporter has no net48 build; instead, xunit.v3's built-in TRX reporter writes Snappier.Tests-net48-<arch>.trx, uploaded as the test-results-net4-<arch> artifact (also on test failure)
    • Coverage cleanup: coverlet.MTP writes Windows paths with forward slashes, so the sed rewrite now matches either slash

Reviewer notes

  • Verified locally: build has no warnings; tests pass on net8.0 and net10.0 (281) and net48 x64/x86 (265), each producing a Cobertura file. The workflow itself has not run yet.
  • The Windows (net48) jobs no longer add a GitHub Actions test summary; their results are in the test-results-net4-<arch> TRX artifacts.

🤖 Generated with Claude Code

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>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 14:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 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

@brantburnett

Copy link
Copy Markdown
Owner Author

Re: bounded runner shutdown when the MalformedFrameInput worker hangs.

Validated at runtime with a temporary test using the same pattern ([Fact(Timeout = 2000)], Task.Run with TestContext.Current.CancellationToken running a body that never returns):

Target Test result Total dotnet test run
net10.0 Timed out at 2 s (failed, canceled) ~5 s, process exited
net48 Timed out at 2 s (failed, canceled) ~5 s, process exited

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>
@brantburnett
brantburnett merged commit b409d9b into main Nov 13, 2026
42 checks passed
@brantburnett
brantburnett deleted the claude/migrate-xunit-v3-4x-d6fb65 branch November 13, 2026 15:55
ogonna-ee pushed a commit to DEFRA/waste-organisations that referenced this pull request Nov 16, 2026
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 compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Snappier&package-manager=nuget&previous-version=1.3.1&new-version=1.3.2)](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>
ooples pushed a commit to ooples/AiDotNet that referenced this pull request Nov 16, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants