Skip to content

test: move the test project to xunit v3 on the Microsoft.Testing.Platform runner - #77

Merged
davidnmbond merged 1 commit into
mainfrom
chore/xunit-v3
Oct 18, 2026
Merged

davidnmbond merged 1 commit into
mainfrom
chore/xunit-v3

Conversation

@davidnmbond

Copy link
Copy Markdown
Contributor

Problem

dotnet test fails on the .NET 10 SDK for this repository:

Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later.

The test project already references xunit.v3 in the package pins but was still on xunit v2 with the VSTest adapter and coverlet's XPlat Code Coverage collector, and global.json has no Testing Platform runner.

Change

  • global.json: test.runner is Microsoft.Testing.Platform.
  • Test project: xunit.v3 replaces xunit and xunit.runner.visualstudio; Microsoft.Testing.Extensions.CodeCoverage replaces coverlet.collector; xunit.runner.json (with failSkips) is now copied to the output folder.
  • Logging: Neovolve.Logging.Xunit.v3 7.2.0 replaces Divergic.Logging.Xunit. Its API is the same, so only the global using changes (and Xunit.Abstractions, a v2 namespace, is dropped).
  • xUnit1051: the 28 calls that took a cancellation token now pass TestContext.Current.CancellationToken. The analyzer is not suppressed.
  • CI: the coverage step uses --coverage --coverage-output-format cobertura --coverage-output ..., writing the file the Codacy upload step already reads, so the "locate report" step is gone.

Verification

  • dotnet build of the test project: succeeds with warnings as errors on.
  • dotnet test --filter "Category!=Integration" with credential-looking environment variables removed: 103 passed, 0 failed (the same 103 as running the test executable by hand before this change).
  • The CI coverage command was run locally with an output folder that did not exist; it exited 0, created the folder and wrote a 412-class Cobertura report.

Not covered by this change

The integration tests (everything deriving from TestWithOutput) need a LogicMonitor portal and a database, so they were not run. This only changes the test runner, packages and CI; no production code changes. The first CI run on this branch is the check on the workflow edit.

…form runner

dotnet test failed outright on the .NET 10 SDK because the project had no Testing Platform runner
configured. The project now uses xunit.v3 with the runner set in global.json, the code coverage
extension instead of coverlet's VSTest collector, and Neovolve.Logging.Xunit.v3 in place of
Divergic.Logging.Xunit. The xUnit1051 analyzer is satisfied by passing
TestContext.Current.CancellationToken at the 28 call sites instead of being suppressed. CI now
collects coverage with --coverage and uploads the same Cobertura file.
@codacy-production

codacy-production Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 4 duplication

Metric Results
Complexity 0
Duplication 4

View in Codacy

🟢 Coverage ∅ diff coverage · -0.19% coverage variation

Metric Results
Coverage variation ✅ -0.19% coverage variation
Diff coverage ✅ ∅ diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (93d28d6) 183649 3534 1.92%
Head commit (a81e3e5) 183093 (-556) 3169 (-365) 1.73% (-0.19%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#77) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@davidnmbond
davidnmbond merged commit 29cc75a into main Oct 18, 2026
8 checks passed
@davidnmbond
davidnmbond deleted the chore/xunit-v3 branch October 18, 2026 15:43
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.

1 participant