V12.0.0/xunit v3 v4 bump - #71
Merged
Merged
Conversation
Upgrade xunit framework suite from v3.2.2 to v4.0.0 with supporting package version updates: Codebelt.Bootstrapper packages to v5.2.1, Extensions.BenchmarkDotNet.Console to v1.3.3, and Microsoft.NET.Test.Sdk to v18.9.0. xunit v4 is a major version bump with breaking changes that requires code updates for full compatibility.
Consolidate Docker test environments from separate net9 and net10 images into a unified ubuntu-testrunner:8-9-10-11 image for improved maintainability. Update DocFX base image from nginx 1.31-alpine to nginx 1.31-alpine and bump docfx from 2.78.4 to 2.78.5.
Remove obsolete analyzer rules no longer needed for code style enforcement: CA1200 (cref tag prefix usage) and IDE0330 (System.Threading.Lock). These rules were disabled due to compatibility constraints with older target frameworks that are no longer relevant. Also fix typo in IDE0036 comment.
Add .gitattributes file to ensure consistent line-ending handling across the repository. Configures text file normalization and merge strategies for version-control files to reduce merge conflicts and ensure consistency across Windows and Unix-like environments.
This is a breaking change for v12.0.0. BlockingManagedApplicationFixture and BlockingManagedWebApplicationFixture have been removed as deprecated types. Applications must migrate to ManagedApplicationFixture and ManagedWebApplicationFixture, which now serve as the default fixtures in ApplicationTestFactory and WebApplicationTestFactory respectively. This aligns the framework with entrypoint-owned deferred host startup patterns.
Update functional tests to verify that ApplicationTestFactory and WebApplicationTestFactory now use ManagedApplicationFixture and ManagedWebApplicationFixture by default. Tests confirm that entrypoint-owned deferred startup is now the standard behavior. Rename and update legacy test fixtures to work with the new defaults.
Update DocFX API documentation to reflect the removal of BlockingManagedApplicationFixture and BlockingManagedWebApplicationFixture. Update namespace and type pages to emphasize ManagedApplicationFixture and ManagedWebApplicationFixture as the standard fixtures. Clarify entrypoint-owned deferred startup behavior in fixture documentation.
Update NuGet package release notes across all packages to document v12.0.0 changes: xunit framework upgrade to v4.0.0, dependency version updates, removal of BlockingManagedApplicationFixture, and improvements to ApplicationTestFactory defaults. Update README.md files to reflect current API and best practices.
Add v12.0.0 release entry to CHANGELOG.md documenting breaking changes, improvements, and ALM updates. Update CONTRIBUTING.md with guidance for v12.0.0 development. Breaking change: removal of BlockingManagedApplicationFixture and BlockingManagedWebApplicationFixture types. Improvement: ApplicationTestFactory now uses ManagedApplicationFixture as the default fixture.
Update XML documentation remarks for ApplicationHostFactory to reflect that the deferred entry-point path is now the standard behavior through managed application fixtures. Remove deprecation warnings about the legacy path as v12.0.0 makes this the default.
Greptile SummaryThe PR upgrades the repository to xUnit v4 and Microsoft.Testing.Platform, revises managed fixture startup behavior, removes obsolete blocking application fixtures, and updates supporting packages and documentation.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. No blocking failure remains. Important Files Changed
Sequence DiagramsequenceDiagram
participant Test
participant Factory
participant ManagedFixture
participant EntryPoint
participant DeferredHost
Test->>Factory: "Create<TEntryPoint>()"
Factory->>ManagedFixture: Use default managed fixture
ManagedFixture->>EntryPoint: Run application entry point
EntryPoint->>DeferredHost: Build and publish host
Test->>DeferredHost: Consume test host
DeferredHost->>DeferredHost: Complete startup
DeferredHost-->>Test: Started host and services
Reviews (4): Last reviewed commit: "💬 update changelog for v12.0.0" | Re-trigger Greptile |
| # Order modifiers | ||
| # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0036 | ||
| # Excluded because of inconsistency with other analyzers | ||
| # Excluded becuase of inconsistency with other analyzers |
There was a problem hiding this comment.
Analyzer comment spelling error
The edited rationale spells “because” as “becuase,” reducing the clarity of the repository-wide analyzer configuration.
Suggested change
| # Excluded becuase of inconsistency with other analyzers | |
| # Excluded because of inconsistency with other analyzers |
Prompt To Fix With AI
This is a comment left during a code review.
Path: .editorconfig
Line: 174
Comment:
**Analyzer comment spelling error**
The edited rationale spells “because” as “becuase,” reducing the clarity of the repository-wide analyzer configuration.
```suggestion
# Excluded because of inconsistency with other analyzers
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Enable the Microsoft.Testing.Platform dotnet test experience for xUnit v4 on .NET 10 and later, with native TRX and coverage reporting support via Microsoft.Testing.Extensions.CodeCoverage.
Add IMPORTANT note in v12.0.0 release describing the CI migration path for xUnit v4 users upgrading to .NET 10+ with MTP support, and document the code coverage fix in the Fixed section.
Register the ApplicationStarted callback before the deferred host is released so StartAsync waits on the correct completion signal. This preserves lazy startup ordering for managed fixtures without reintroducing the legacy registration race.
Added bug fix documentation for deferred host startup completion fix to both Codebelt.Extensions.Xunit.Hosting and Codebelt.Extensions.Xunit.Hosting.AspNetCore package release notes.
Restructured changelog sections to reorganize breaking changes into Added/Changed/Removed/Fixed categories, improving clarity on the major xUnit v4 migration and managed fixture improvements.
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.
This pull request updates documentation and configuration for the xUnit hosting test infrastructure, clarifying lifecycle management of test fixtures, removing obsolete compatibility examples, and updating default behaviors in the documentation. It also includes minor Dockerfile and configuration cleanups. The most important changes are summarized below.
Documentation updates for fixture lifecycle and defaults:
ApplicationTestFactoryandWebApplicationTestFactorynow useManagedApplicationFixture<TEntryPoint>andManagedWebApplicationFixture<TEntryPoint>by default, making entrypoint-owned startup the standard path for both generic host and ASP.NET Core test scenarios. Explicit instructions are provided for when to use alternative fixture types. [1] [2] [3] [4] [5] [6] [7]BlockingManagedvariants from summary tables and clarifying their status as compatibility-only. [1] [2]Removal of obsolete compatibility examples:
BlockingManagedApplicationFixture<TEntryPoint>andBlockingManagedWebApplicationFixture<TEntryPoint>, reflecting their deprecated status and encouraging use of the managed fixture path. [1] [2]Configuration and infrastructure updates:
.gitattributesfile to enforce consistent line endings and provide merge/diff settings for various file types..docfx/Dockerfile.docfxto usecodebeltnet/docfx:2.78.5(was 2.78.4), ensuring the latest documentation tooling is used.Minor documentation and config cleanups:
.editorconfigand fixed a typo in a comment. [1] [2]These changes modernize the documentation, clarify recommended usage patterns, and clean up deprecated paths and configuration.