Skip to content

V12.0.0/xunit v3 v4 bump - #71

Merged
gimlichael merged 15 commits into
mainfrom
v12.0.0/xunit-v3-v4-bump
Aug 24, 2026
Merged

V12.0.0/xunit v3 v4 bump#71
gimlichael merged 15 commits into
mainfrom
v12.0.0/xunit-v3-v4-bump

Conversation

@gimlichael

Copy link
Copy Markdown
Member

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:

  • Updated documentation to clarify that ApplicationTestFactory and WebApplicationTestFactory now use ManagedApplicationFixture<TEntryPoint> and ManagedWebApplicationFixture<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]
  • Revised lifecycle documentation for both generic host and ASP.NET Core fixtures, removing references to the obsolete BlockingManaged variants from summary tables and clarifying their status as compatibility-only. [1] [2]

Removal of obsolete compatibility examples:

  • Deleted example documentation files for BlockingManagedApplicationFixture<TEntryPoint> and BlockingManagedWebApplicationFixture<TEntryPoint>, reflecting their deprecated status and encouraging use of the managed fixture path. [1] [2]

Configuration and infrastructure updates:

  • Added a .gitattributes file to enforce consistent line endings and provide merge/diff settings for various file types.
  • Updated .docfx/Dockerfile.docfx to use codebeltnet/docfx:2.78.5 (was 2.78.4), ensuring the latest documentation tooling is used.

Minor documentation and config cleanups:

  • Removed the CA1200 rule suppression and the IDE0330 suppression from .editorconfig and fixed a typo in a comment. [1] [2]

These changes modernize the documentation, clarify recommended usage patterns, and clean up deprecated paths and configuration.

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.
@gimlichael gimlichael self-assigned this Aug 24, 2026
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown

Greptile Summary

The 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.

  • Defaults application and web application test factories to managed fixtures.
  • Adjusts deferred host startup synchronization and related functional tests.
  • Updates package versions, test-runner configuration, release notes, and lifecycle documentation.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
src/Codebelt.Extensions.Xunit.Hosting/Internal/DeferredHostBuilder.cs Revises deferred host startup completion ordering for managed fixture lifecycle handling.
src/Codebelt.Extensions.Xunit.Hosting/ApplicationTestFactory.cs Changes the generic application test factory to use the managed application fixture by default.
src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebApplicationTestFactory.cs Changes the web application test factory to use the managed web application fixture by default.
Directory.Packages.props Upgrades xUnit, test SDK, Codebelt, and coverage dependencies for the major release.
global.json Selects Microsoft.Testing.Platform as the repository test runner.

Sequence Diagram

sequenceDiagram
  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
Loading

Reviews (4): Last reviewed commit: "💬 update changelog for v12.0.0" | Re-trigger Greptile

Comment thread .editorconfig
# 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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!

Fix in Codex

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.
@gimlichael
gimlichael merged commit 9ea21bb into main Aug 24, 2026
22 checks passed
@gimlichael
gimlichael deleted the v12.0.0/xunit-v3-v4-bump branch August 24, 2026 18:27
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.

2 participants