Repository navigation
Upgrade tests to xUnit v3 - #562
Merged
Merged
Conversation
added 3 commits
October 9, 2026 10:11
Replace the deprecated xunit package with xunit.v3 and run tests through Microsoft.Testing.Platform. Test projects are executables, coverage uses Microsoft.Testing.Extensions.CodeCoverage, and the GitHub and Azure Pipelines test commands use the new runner.
Use TestContext.Current.CancellationToken for HttpClient and ReadAsStringAsync calls so xUnit1051 is satisfied without suppressing the analyzer.
Run the TypeScript 7 compiler before static web asset discovery so a rebuild does not fail when the generated activelogin-main.js has been deleted.
There was a problem hiding this comment.
🔵 Needs a closer look
The cross-platform CI coverage and result-publishing migration remains explicitly unconfirmed.
0 open findings
What changed in this PR
Upgrades all test projects to xUnit v3 with Microsoft.Testing.Platform and updates CI, coverage, cancellation, and static-web-asset handling.
Changes:
- Migrates test dependencies and execution to xUnit v3/Microsoft.Testing.Platform.
- Updates CI coverage and Azure TRX publishing.
- Compiles TypeScript before static web asset discovery.
| File | Description |
|---|---|
test/Directory.Build.props |
Makes test projects executable. |
test/ActiveLogin.Authentication.BankId.UAParser.Test/ActiveLogin.Authentication.BankId.UAParser.Test.csproj |
Migrates UAParser tests and coverage. |
test/ActiveLogin.Authentication.BankId.Core.Test/ActiveLogin.Authentication.BankId.Core.Test.csproj |
Migrates Core tests and coverage. |
test/ActiveLogin.Authentication.BankId.AzureKeyVault.Test/ActiveLogin.Authentication.BankId.AzureKeyVault.Test.csproj |
Migrates Azure Key Vault tests. |
test/ActiveLogin.Authentication.BankId.AspNetCore.Test/BankId_UiSign_Tests.cs |
Propagates test cancellation tokens. |
test/ActiveLogin.Authentication.BankId.AspNetCore.Test/BankId_UiPayment_Tests.cs |
Propagates test cancellation tokens. |
test/ActiveLogin.Authentication.BankId.AspNetCore.Test/BankId_UiAuth_Tests.cs |
Propagates test cancellation tokens. |
test/ActiveLogin.Authentication.BankId.AspNetCore.Test/ActiveLogin.Authentication.BankId.AspNetCore.Test.csproj |
Migrates ASP.NET Core tests. |
test/ActiveLogin.Authentication.BankId.Api.Test/BankIdVerifyApiClient_Tests.cs |
Adds cancellation to content reads. |
test/ActiveLogin.Authentication.BankId.Api.Test/BankIdAppApiClient_Tests.cs |
Adds cancellation to content reads. |
test/ActiveLogin.Authentication.BankId.Api.Test/ActiveLogin.Authentication.BankId.Api.Test.csproj |
Migrates API tests and removes obsolete tooling. |
src/ActiveLogin.Authentication.BankId.AspNetCore/ActiveLogin.Authentication.BankId.AspNetCore.csproj |
Fixes TypeScript/static-asset ordering. |
README.md |
Documents the new test runner. |
global.json |
Selects Microsoft.Testing.Platform. |
azure-pipelines.yml |
Updates coverage and TRX publishing. |
.github/workflows/test.yml |
Updates test workflow invocation. |
.github/workflows/build.yml |
Updates build workflow test invocation. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
added 2 commits
October 9, 2026 11:35
Microsoft Testing Platform's --coverage flag only produces binary .coverage files, so Azure DevOps had no HTML report to render. - Output coverage as Cobertura via --coverage-output-format cobertura - Add PublishCodeCoverageResults@2 step to publish the results
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.
Upgrade tests to xUnit v3
Replaces the deprecated
xunit2.9.3 package withxunit.v34.0.1 and moves test execution to Microsoft.Testing.Platform.Test projects
xunit.v3instead ofxunit, and remove the obsoletedotnet-xunittool.xunit.runner.visualstudioand include itsbuildtransitiveassets so the adapter targets are imported.Microsoft.Testing.Extensions.CodeCoverageto each test project and removecoverlet.collector. Coverage is now collected withdotnet test --coverage.TestContext.Current.CancellationTokentoHttpClientandReadAsStringAsynccalls so the xUnit1051 analyzer is satisfied without suppressing it.Runner and CI
dotnet testinto Microsoft.Testing.Platform inglobal.json. The .NET 10 SDK no longer runs these projects through the VSTestdotnet testpath.dotnet test --solution ... --coverage.PublishTestResults, since the oldDotNetCoreCLItest task injected VSTest arguments that this runner rejects.Also included
activelogin-main.jsbefore the SDK collectedwwwroot, which failed the build. CI did not hit this because it does not rebuild and the generated file is not in source control.Test plan
dotnet test --solution ActiveLogin.Authentication.sln— 319 tests passed