Repository navigation
Migrate test projects to xUnit v3 - #101
Merged
Merged
Conversation
The pub/sub tests shared port 5556 between themselves and overlapped the 5555-5558 range TestServiceBusWithNetMq binds, which xUnit runs in parallel, and no test disposed its publishers, sources or buses. Give each pub/sub test its own port and dispose everything before asserting. Fixes #72 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests that waited on publish/send tasks now await them. The "returns with no observers" tests checked .Wait(1); they now assert the returned task is already completed, which is what the buses guarantee. Fixes #73 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xunit.v3 runs on Microsoft.Testing.Platform, which the .NET 10 SDK only supports through the new dotnet test mode, so opt in via global.json. CI filters with xUnit's --filter-not-trait and ignores exit code 8 (no tests ran) for the projects that only have Explicit tests. Pass TestContext.Current.CancellationToken to delays, per xUnit1051. Fixes #75 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
christopherread
added a commit
that referenced
this pull request
Oct 25, 2026
Master now runs tests on Microsoft.Testing.Platform (#101), so use --project and --filter-trait. The NetMQ tests no longer clash over ports (#80), so run them too. The broker steps now come before the unit test step, so this branch no longer edits the lines master changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
christopherread
added a commit
that referenced
this pull request
Oct 25, 2026
Master now runs tests on Microsoft.Testing.Platform (#101), so use --project and --filter-trait. The NetMQ tests no longer clash over ports (#80), so run them too. The broker steps now come before the unit test step, so this branch no longer edits the lines master changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 25, 2026
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.
Fixes #75. Merge after #80 and #81: this branch includes their commits (cherry-picked, so history stays linear), because the xUnit v3 fixes touch the same test lines. The diff includes their changes until they merge.
Replaces #100. That branch merged #80 and #81 in, and GitVersion 6's Mainline strategy crashes on those merge commits (
InvalidOperationExceptioninMainlineVersionStrategy). The files here are identical.Changes
xunit2.9.3 (deprecated) →xunit.v34.0.2 inDirectory.Packages.propsand all 9 test projects.xunit.runner.visualstudio4.0.1 andMicrosoft.NET.Test.Sdkstay, so IDE test explorers keep working.<OutputType>Exe</OutputType>, as xUnit v3 requires.using Xunit.Abstractions;is removed;ITestOutputHelperis now in theXunitnamespace.Task.DelayandCloseAsynccalls in the broker tests that should passTestContext.Current.CancellationToken. Fixed.dotnet test. Microsoft documents the old route as legacy. So a newglobal.jsonopts into MTP mode with"test": { "runner": "Microsoft.Testing.Platform" }. It has nosdksection, so it doesn't pin an SDK version.dotnet test --solution Obvs.sln … -- --filter-not-trait "Category=Explicit" --ignore-exit-code 8.Explicittests.For developers
dotnet testsyntax changes in MTP mode:--filter Category=Explicit→-- --filter-trait "Category=Explicit"dotnet test X.csproj→dotnet test --project X.csprojdotnet test X.sln→dotnet test --solution X.sln#82 adds a CI step that runs the broker tests with the old syntax (
dotnet test Obvs.RabbitMQ.Tests --filter Category=Explicit). Whichever of #82 and this PR merges second needs that step converted to:dotnet test --project Obvs.RabbitMQ.Tests --no-build --configuration Release -- --filter-trait "Category=Explicit"(and the same for NATS and Kafka). I'll update whichever branch is left.Testing
Explicittests.--filter-trait "Category=Explicit"): passed in 10 of 11 runs. One run had a single failure that didn't recur in the next 8 runs. These tests rely on fixedTask.Delaytimings.🤖 Generated with Claude Code