Repository navigation
test: move the test project to xunit v3 on the Microsoft.Testing.Platform runner - #77
Merged
Merged
Conversation
…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.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 4 |
🟢 Coverage ∅ diff coverage · -0.19% coverage variation
Metric Results Coverage variation ✅ -0.19% coverage variation Diff coverage ✅ ∅ diff coverage 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.
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
dotnet testfails on the .NET 10 SDK for this repository:The test project already references
xunit.v3in the package pins but was still on xunit v2 with the VSTest adapter and coverlet'sXPlat Code Coveragecollector, andglobal.jsonhas no Testing Platform runner.Change
global.json:test.runnerisMicrosoft.Testing.Platform.xunit.v3replacesxunitandxunit.runner.visualstudio;Microsoft.Testing.Extensions.CodeCoveragereplacescoverlet.collector;xunit.runner.json(withfailSkips) is now copied to the output folder.Neovolve.Logging.Xunit.v37.2.0 replacesDivergic.Logging.Xunit. Its API is the same, so only the global using changes (andXunit.Abstractions, a v2 namespace, is dropped).TestContext.Current.CancellationToken. The analyzer is not suppressed.--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 buildof 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).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.