Skip to content

Conversation

@gimlichael
Copy link
Member

@gimlichael gimlichael commented Apr 1, 2025

This pull request includes several updates and improvements across multiple files, focusing on version updates, bug fixes, new features, and enhancements to the hosting and logging functionalities.

Version Updates and Dependency Changes:

  • Updated version from 9.1.0 to 9.1.1 in multiple PackageReleaseNotes.txt files. [1] [2] [3] [4]

Bug Fixes:

  • Fixed AspNetCoreHostTest and HostTest classes to ensure backward compatibility with behaviors prior to the 9.1.0 release. [1] [2] [3]

New Features and Improvements:

  • Extended LoggerExtensions class with a new overload of GetTestStore method that takes an optional categoryName argument. [1] [2] [3] [4]
  • Improved HostFixture class to align IHostEnvironment.ApplicationName with the logic found in AspNetCoreHostFixture class. [1] [2]

Code Refactoring:

  • Added a new constructor to AspNetCoreHostTest and HostTest classes to support skipping host fixture initialization, reducing code duplication. [1] [2] [3]
  • Refactored XunitTestLogger to inherit from InMemoryTestStore<XunitTestLoggerEntry> and added logging functionality directly to the test store. [1] [2]

Documentation Updates:

  • Updated CHANGELOG.md to include details of the new features, changes, and bug fixes introduced in version 9.1.1.

Summary by CodeRabbit

  • Chores
    • Updated package version from 9.1.0 to 9.1.1 with refreshed dependency definitions supporting .NET 9, .NET 8, and .NET Standard 2.0.
  • New Features
    • Added a logging overload that enables optional filtering by category.
  • Bug Fixes
    • Resolved issues to restore consistent and backward-compatible behavior in host and test setups.
  • Tests
    • Expanded and refined tests to validate the updated configuration and logging functionality.

@gimlichael gimlichael self-assigned this Apr 1, 2025
Copilot AI review requested due to automatic review settings April 1, 2025 19:04
@coderabbitai
Copy link

coderabbitai bot commented Apr 1, 2025

Walkthrough

The pull request updates package versions from 9.1.0 to 9.1.1 and enhances framework availability documentation across several NuGet packages. Release notes and the changelog now include additional dependency and bug fix details as well as new feature notes. Constructors in host test classes have been modified to accept a boolean flag to optionally skip fixture initialization, streamlining initialization flows. Logging functionality is improved with a new overload that accepts an optional category name, and tests have been updated to reflect these changes.

Changes

File(s) Change Summary
.nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt, .nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/PackageReleaseNotes.txt, .nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt, .nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt, CHANGELOG.md Updated version numbers to 9.1.1, added .NET framework availability notes, updated dependency and bug fix sections, and detailed new features.
src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostTest.cs, src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs, src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs, src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs, src/Codebelt.Extensions.Xunit.Hosting/HostFixture.cs Introduced new constructor overloads with a boolean flag (skipHostFixtureInitialization), modified host configuration and initialization flow, and added a new configuration step in HostFixture.
src/Codebelt.Extensions.Xunit.Hosting/LoggerExtensions.cs, src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs, src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs Enhanced logging by adding a GetTestStore overload with an optional categoryName, updated logger inheritance to support in-memory storage, and improved key handling via case-insensitive dictionary.
Test Files (under test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/ and test/Codebelt.Extensions.Xunit.Hosting.Tests/) Simplified host fixture initialization by removing redundant validations and configuration callbacks, updated logger method invocations, and introduced new tests for GenericHostTestFactory.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as Test/Client
    participant TestClass as HostTest/AspNetCoreHostTest
    participant Fixture as HostFixture

    Caller->>TestClass: Instantiate with (skipHostFixtureInitialization flag)
    alt skipHostFixtureInitialization == true
        TestClass-->>Caller: Return instance without initialization
    else skipHostFixtureInitialization == false
        TestClass->>Fixture: Check fixture validity
        Fixture-->>TestClass: Return state (valid/invalid)
        alt Fixture is invalid
            TestClass->>Fixture: Set configuration callbacks
            TestClass->>Fixture: Call ConfigureHost
        end
        TestClass->>TestClass: Assign Host, ServiceProvider, Application
        TestClass->>TestClass: Call Configure with configuration & environment
        TestClass-->>Caller: Return fully initialized instance
    end
Loading

Possibly related PRs

Poem

I'm a rabbit tapping to a brand new beat,
Hopping through changes, oh so neat.
Versions jump high, and logs sing clear,
With fixture flags, doubts disappear.
In code and tests, I leap with glee—
Merry changes set my spirit free! 🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 950cf17 and de9d1ff.

📒 Files selected for processing (21)
  • .nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt (1 hunks)
  • CHANGELOG.md (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/HostFixture.cs (2 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/LoggerExtensions.cs (4 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs (2 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs (2 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs (0 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/ValidHostTest.cs (0 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/MvcAspNetCoreHostTestTest.cs (0 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/WebHostTestFactoryTest.cs (1 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/Assets/ValidHostTest.cs (0 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/GenericHostTestFactoryTest.cs (1 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/HostTestTest.cs (0 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/ServiceCollectionExtensions.cs (2 hunks)
💤 Files with no reviewable changes (5)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/MvcAspNetCoreHostTestTest.cs
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/HostTestTest.cs
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/Assets/ValidHostTest.cs
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/ValidHostTest.cs

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request updates the version to 9.1.1 and refactors host fixture initialization logic, adds a new ILogger extension overload, and includes minor improvements to logging functionality.

  • Removed duplicate and redundant host fixture initialization in various test files.
  • Added a new GetTestStore overload that accepts an optional categoryName parameter and updated associated logging classes.
  • Updated HostFixture to set the application name from the caller's assembly and improved constructor overloads to allow skipping host fixture initialization.

Reviewed Changes

Copilot reviewed 17 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/Codebelt.Extensions.Xunit.Hosting.Tests/HostTestTest.cs Removed redundant host fixture initialization in favor of the new constructor overload.
test/Codebelt.Extensions.Xunit.Hosting.Tests/GenericHostTestFactoryTest.cs Added tests for the new GenericHostTestFactory behavior.
test/Codebelt.Extensions.Xunit.Hosting.Tests/Assets/ValidHostTest.cs Simplified initialization by removing duplicate setup code.
test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/WebHostTestFactoryTest.cs Updated GetTestStore call to include a null categoryName parameter.
test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/MvcAspNetCoreHostTestTest.cs Removed redundant host fixture initialization code.
test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/ValidHostTest.cs Simplified initialization by removing duplicate setup calls.
test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs Removed redundant host fixture initialization code.
src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs Updated logger provider with string comparer and added an indexer to retrieve stores by category name.
src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs Modified logger to inherit from InMemoryTestStore and added logging entries directly.
src/Codebelt.Extensions.Xunit.Hosting/LoggerExtensions.cs Added a new GetTestStore overload that accepts an optional category name and updated the obsolete generic version.
src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs Introduced a new constructor overload to allow skipping host fixture initialization and refactored host initialization logic.
src/Codebelt.Extensions.Xunit.Hosting/HostFixture.cs Updated host configuration to set ApplicationName from the caller's assembly.
src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs Updated constructors to use the new skipHostFixtureInitialization parameter.
src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs Updated constructors to use the new skipHostFixtureInitialization parameter.
src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostTest.cs Updated constructors to use the new skipHostFixtureInitialization parameter.
CHANGELOG.md Documented the new features, changes, and bug fixes for version 9.1.1.
Files not reviewed (4)
  • .nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt: Language not supported
  • .nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/PackageReleaseNotes.txt: Language not supported
  • .nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt: Language not supported
  • .nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt: Language not supported

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt (2)

5-5: Consider simplifying the wording

The phrase "with respect to TFMs" could be simplified for better readability.

-CHANGED Dependencies to latest and greatest with respect to TFMs
+CHANGED Dependencies to latest and greatest for TFMs
🧰 Tools
🪛 LanguageTool

[style] ~5-~5: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...GED Dependencies to latest and greatest with respect to TFMs
 

Bug Fixes

  • FIXED HostTest ...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


8-9: Good backward compatibility fixes

The notes clearly explain the fixes applied to restore pre-9.1.0 behavior for both classes, ensuring backward compatibility.

Consider simplifying "prior to" to "before" in both lines for conciseness:

-FIXED HostTest class in the Codebelt.Extensions.Xunit.Hosting namespace to have same behavior as prior to 9.1.0 release (hereby being backward compatible as originally intended)
-FIXED LoggerExtensions class in the Codebelt.Extensions.Xunit.Hosting namespace to have same behavior as prior to 9.1.0 release (hereby being backward compatible as originally intended)
+FIXED HostTest class in the Codebelt.Extensions.Xunit.Hosting namespace to have same behavior as before 9.1.0 release (hereby being backward compatible as originally intended)
+FIXED LoggerExtensions class in the Codebelt.Extensions.Xunit.Hosting namespace to have same behavior as before 9.1.0 release (hereby being backward compatible as originally intended)
🧰 Tools
🪛 LanguageTool

[style] ~8-~8: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ting namespace to have same behavior as prior to 9.1.0 release (hereby being backward co...

(EN_WORDINESS_PREMIUM_PRIOR_TO)


[style] ~9-~9: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ting namespace to have same behavior as prior to 9.1.0 release (hereby being backward co...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 950cf17 and 77deecb.

📒 Files selected for processing (21)
  • .nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt (1 hunks)
  • CHANGELOG.md (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/HostFixture.cs (2 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs (1 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/LoggerExtensions.cs (3 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs (2 hunks)
  • src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs (2 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs (0 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/ValidHostTest.cs (0 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/MvcAspNetCoreHostTestTest.cs (0 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/WebHostTestFactoryTest.cs (1 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/Assets/ValidHostTest.cs (0 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/GenericHostTestFactoryTest.cs (1 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/HostTestTest.cs (0 hunks)
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/ServiceCollectionExtensions.cs (2 hunks)
💤 Files with no reviewable changes (5)
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/MvcAspNetCoreHostTestTest.cs
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/Assets/ValidHostTest.cs
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/Assets/ValidHostTest.cs
  • test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs
  • test/Codebelt.Extensions.Xunit.Hosting.Tests/HostTestTest.cs
🧰 Additional context used
🧬 Code Definitions (5)
src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs (2)
src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs (3)
  • XunitTestLogger (8-63)
  • XunitTestLogger (14-18)
  • XunitTestLogger (20-24)
src/Codebelt.Extensions.Xunit.Hosting/LoggerExtensions.cs (2)
  • ITestStore (26-53)
  • ITestStore (66-69)
src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs (3)
src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/ServiceCollectionExtensions.cs (1)
  • IServiceCollection (21-38)
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs (3)
  • IServiceCollection (25-51)
  • IServiceCollection (58-62)
  • IServiceCollection (73-78)
src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs (1)
  • InitializeHostFixture (28-40)
test/Codebelt.Extensions.Xunit.Hosting.Tests/GenericHostTestFactoryTest.cs (2)
test/Codebelt.Extensions.Xunit.Hosting.Tests/HostTestTest.cs (5)
  • Fact (27-34)
  • Fact (36-43)
  • Fact (45-52)
  • Fact (54-58)
  • Fact (60-64)
test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/WebHostTestFactoryTest.cs (4)
  • Fact (26-51)
  • Fact (53-81)
  • Fact (83-98)
  • Fact (100-111)
src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs (3)
src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostFixtureExtensions.cs (1)
  • HasValidState (18-22)
src/Codebelt.Extensions.Xunit.Hosting/HostFixtureExtensions.cs (1)
  • HasValidState (18-24)
src/Codebelt.Extensions.Xunit.Hosting/IHostFixture.cs (1)
  • ConfigureHost (36-36)
src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs (2)
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs (3)
  • IServiceCollection (25-51)
  • IServiceCollection (58-62)
  • IServiceCollection (73-78)
src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs (1)
  • InitializeHostFixture (33-47)
🪛 LanguageTool
.nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt

[style] ~5-~5: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...GED Dependencies to latest and greatest with respect to TFMs
 
Version 9.1.0
Availability: ....

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)

.nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt

[uncategorized] ~5-~5: You might be missing the article “the” here.
Context: ... 8
 

ALM

  • CHANGED Dependencies to latest and greatest with respect to TFMs
     
    V...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[style] ~5-~5: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...GED Dependencies to latest and greatest with respect to TFMs
 
Version 9.1.0
Availability: ....

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)

CHANGELOG.md

[style] ~22-~22: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ting namespace to have same behavior as prior to 9.1.0 release (hereby being backward ...

(EN_WORDINESS_PREMIUM_PRIOR_TO)


[style] ~23-~23: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ting namespace to have same behavior as prior to 9.1.0 release (hereby being backward ...

(EN_WORDINESS_PREMIUM_PRIOR_TO)


[style] ~24-~24: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...Core namespace to have same behavior as prior to 9.1.0 release (hereby being backward co...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

.nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt

[style] ~5-~5: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...GED Dependencies to latest and greatest with respect to TFMs
 

Bug Fixes

  • FIXED HostTest ...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~8-~8: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ting namespace to have same behavior as prior to 9.1.0 release (hereby being backward co...

(EN_WORDINESS_PREMIUM_PRIOR_TO)


[style] ~9-~9: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ting namespace to have same behavior as prior to 9.1.0 release (hereby being backward co...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

.nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/PackageReleaseNotes.txt

[style] ~5-~5: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...GED Dependencies to latest and greatest with respect to TFMs
 

Bug Fixes

  • FIXED AspNetCor...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~8-~8: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...Core namespace to have same behavior as prior to 9.1.0 release (hereby being backward co...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: 🧪 Test (windows-2022, Release)
  • GitHub Check: 🧪 Test (windows-2022, Debug)
🔇 Additional comments (38)
.nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt (1)

1-6: Version update looks good.

The version increment from 9.1.0 to 9.1.1 with appropriate framework availability information and dependency update notes follows the established pattern in this file.

🧰 Tools
🪛 LanguageTool

[style] ~5-~5: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...GED Dependencies to latest and greatest with respect to TFMs
 
Version 9.1.0
Availability: ....

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)

CHANGELOG.md (3)

10-15: New feature documentation is clear and descriptive.

The changelog entry properly documents the new feature - an overload of the GetTestStore method that takes an optional category name parameter.


16-19: Change description is informative.

The alignment of IHostEnvironment.ApplicationName behavior between HostFixture and AspNetCoreHostFixture classes is clearly documented, explaining that it will now use the assembly name of the calling Test type.


20-24: Bug fix documentation is thorough.

The changelog properly documents backward compatibility fixes for HostTest, LoggerExtensions, and AspNetCoreHostTest classes to restore pre-9.1.0 behavior.

🧰 Tools
🪛 LanguageTool

[style] ~22-~22: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ting namespace to have same behavior as prior to 9.1.0 release (hereby being backward ...

(EN_WORDINESS_PREMIUM_PRIOR_TO)


[style] ~23-~23: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ting namespace to have same behavior as prior to 9.1.0 release (hereby being backward ...

(EN_WORDINESS_PREMIUM_PRIOR_TO)


[style] ~24-~24: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...Core namespace to have same behavior as prior to 9.1.0 release (hereby being backward co...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/WebHostTestFactoryTest.cs (1)

76-76: Updated method call to use new overload.

The test has been updated to use the new overload of GetTestStore that accepts a category name parameter, passing null to maintain the original behavior while adapting to the new API.

.nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt (1)

1-6: Version update is consistent.

The version increment from 9.1.0 to 9.1.1 with framework availability information and dependency update notes maintains consistency with other package release notes in this PR.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~5-~5: You might be missing the article “the” here.
Context: ... 8
 

ALM

  • CHANGED Dependencies to latest and greatest with respect to TFMs
     
    V...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[style] ~5-~5: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...GED Dependencies to latest and greatest with respect to TFMs
 
Version 9.1.0
Availability: ....

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)

src/Codebelt.Extensions.Xunit.Hosting/HostFixture.cs (2)

60-67: Improved host configuration with proper application name

The addition of ConfigureHostConfiguration sets the application name to match the caller's assembly name, aligning the behavior with AspNetCoreHostFixture. This ensures consistent behavior across host fixtures and provides proper application identification in logs and other contexts.


70-74: Properly formatted service provider configuration

The code maintains the same validation settings but with improved formatting, making it more readable.

.nuget/Codebelt.Extensions.Xunit.Hosting.AspNetCore/PackageReleaseNotes.txt (1)

1-9: Well-documented version update with clear bug fix description

The release notes properly document the version update to 9.1.1 and clearly explain the bug fix for AspNetCoreHostTest to maintain backward compatibility. This provides essential information for users upgrading from 9.1.0.

🧰 Tools
🪛 LanguageTool

[style] ~5-~5: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...GED Dependencies to latest and greatest with respect to TFMs
 

Bug Fixes

  • FIXED AspNetCor...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~8-~8: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...Core namespace to have same behavior as prior to 9.1.0 release (hereby being backward co...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

src/Codebelt.Extensions.Xunit.Hosting/XunitTestLogger.cs (2)

8-8: Enhanced logger with in-memory storage capabilities

The XunitTestLogger now inherits from InMemoryTestStore<XunitTestLoggerEntry>, providing built-in storage for log entries. This change improves the logger's functionality by making it also serve as a test store, which aligns with the PR objectives.


35-35: Added local storage of log entries

The logger now stores log entries locally in addition to sending them to the provider. This change enables direct access to log entries from the logger instance, improving testability.

src/Codebelt.Extensions.Xunit.Hosting/XunitTestLoggerProvider.cs (2)

10-10: Improved case-insensitive logger name handling

Using StringComparer.OrdinalIgnoreCase for the loggers dictionary ensures that logger category names are compared in a case-insensitive manner, which is a good practice as category names shouldn't be case-sensitive.


36-36: Added direct access to specific loggers by category name

The new indexer property allows direct access to a logger by its category name, which supports the enhanced functionality in LoggerExtensions.GetTestStore that now accepts an optional categoryName parameter. This provides more granular access to log entries.

.nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt (3)

1-2: Version update looks good!

The version has been correctly incremented from 9.1.0 to 9.1.1 with proper formatting.


12-12: Good improvement to HostFixture

The alignment of ApplicationName property with AspNetCoreHostFixture class ensures consistent behavior across the hosting implementations.


15-15: Well-documented new feature

The new GetTestStore overload with an optional categoryName parameter is clearly documented.

test/Codebelt.Extensions.Xunit.Hosting.Tests/GenericHostTestFactoryTest.cs (3)

7-11: Well-structured test class

The GenericHostTestFactoryTest class follows the proper inheritance pattern from Test base class and has a clean constructor implementation.


13-28: Good test for Create method

The test correctly verifies that the caller type matches the test class type and that the application name is set to the assembly name of the test class. This is consistent with similar tests in WebHostTestFactoryTest.


31-51: Comprehensive test for CreateWithHostBuilderContext

This test thoroughly validates the functionality of the CreateWithHostBuilderContext method by:

  1. Ensuring context and its properties are not null
  2. Verifying services are not null
  3. Checking that ApplicationName is properly set to the assembly name

The test provides good coverage of the method's behavior.

test/Codebelt.Extensions.Xunit.Hosting.Tests/ServiceCollectionExtensions.cs (6)

18-18: Method name updated for clarity

The test method name has been improved to more accurately reflect the method being tested (AddXunitTestLogging).


25-31: Enhanced test coverage for GetTestStore

The test now validates multiple scenarios for GetTestStore:

  1. Basic retrieval with default parameters
  2. Retrieval with explicit category name
  3. Retrieval with null category (all loggers)

This ensures comprehensive coverage of the new overload functionality.


32-40: Testing multiple loggers

The test has been enhanced to use two different loggers (logger1 and logger2) with distinct log messages. This provides better coverage by testing the logging functionality across different logger instances.


41-41: Good error handling test

The added test for KeyNotFoundException when using an invalid category name ensures robust error handling is in place.


43-53: Comprehensive logger store assertions

The expanded assertions verify:

  1. Logger store equality for the same source
  2. Logger object validity
  3. Correct count of logged entries for each store

This provides thorough validation of the logger stores' behavior.


62-70: Complete verification of log entries

The assertions thoroughly check all logged entries, including the new unique message from logger2, ensuring that the test store properly captures and maintains all log entries.

src/Codebelt.Extensions.Xunit.Hosting/HostTest.cs (3)

25-30: Improved constructor with appropriate documentation

The original constructor has been updated to delegate to the new constructor with skipHostFixtureInitialization set to false by default. The XML documentation has been enhanced with exception information.


32-42: Well-documented new constructor

The new constructor has clear XML documentation that explains its purpose and parameters, including the exception condition when hostFixture is null.


45-56: Enhanced initialization flow with skip option

The initialization logic has been improved to:

  1. Allow skipping initialization with the new parameter
  2. Check fixture state validity before proceeding
  3. Configure the host only when necessary

This enhancement reduces redundant initializations and improves flexibility, particularly in test scenarios where custom initialization is needed.

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/AspNetCoreHostTest.cs (2)

22-22: Implementation aligns with base class changes.

The constructor now calls the new overloaded constructor with the skipHostFixtureInitialization parameter set to false, preserving the original behavior while supporting the new initialization flow.


26-48: Good addition of the skipHostFixtureInitialization parameter.

The new constructor provides flexibility by allowing tests to skip host fixture initialization when needed. The implementation correctly handles both initialization paths with clear early return logic when skipping is enabled. This change helps reduce code duplication in derived classes that need custom initialization flows.

src/Codebelt.Extensions.Xunit.Hosting/LoggerExtensions.cs (4)

18-18: Documentation update for new parameter.

The added parameter description clearly explains the purpose of the categoryName parameter and its default behavior.


26-26: Enhanced method signature with optional parameter.

The GetTestStore method now accepts an optional categoryName parameter, allowing for more targeted log retrieval while maintaining backward compatibility with existing code.


45-47: Improved filtering capability for test logs.

The conditional return statement efficiently handles both cases - returning either all logs or just those for a specific category. This enhances the testing capabilities by allowing more precise verification of log messages.


68-68: Updated obsolete method to use new parameter.

The obsolete GetTestStore<T> method now correctly uses the new overload, passing the full type name as the category name to maintain consistent behavior.

src/Codebelt.Extensions.Xunit.Hosting/GenericHostTest.cs (2)

14-14: Properly leverages the new base class parameter.

The constructor now passes true to the base class constructor for skipHostFixtureInitialization, preventing duplicate initialization since GenericHostTest performs its own initialization in the InitializeHostFixture method called on line 18.


21-21: Consistent initialization pattern across constructors.

This constructor also correctly passes true to skip the base initialization, maintaining consistency with the other constructor and ensuring that initialization happens only once through the local InitializeHostFixture method.

src/Codebelt.Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs (2)

17-17: Prevents duplicate initialization.

The constructor now passes true to the base constructor to skip initialization at that level, since WebHostTest has its own initialization logic in the InitializeHostFixture method called on line 22. This change ensures proper initialization flow.


25-25: Consistent initialization approach.

Similar to the first constructor, this one correctly passes true to skip base initialization, maintaining a consistent pattern across all constructors in the class hierarchy and preventing redundant initialization.

@codecov
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

Attention: Patch coverage is 93.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 91.17%. Comparing base (950cf17) to head (de9d1ff).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...Extensions.Xunit.Hosting.AspNetCore/WebHostTest.cs 0.00% 0 Missing and 2 partials ⚠️
...debelt.Extensions.Xunit.Hosting/GenericHostTest.cs 0.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #27      +/-   ##
==========================================
+ Coverage   84.58%   91.17%   +6.59%     
==========================================
  Files          32       32              
  Lines         668      714      +46     
  Branches       85       91       +6     
==========================================
+ Hits          565      651      +86     
+ Misses        100       58      -42     
- Partials        3        5       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 1, 2025

@gimlichael gimlichael merged commit 52e412b into main Apr 1, 2025
21 checks passed
@gimlichael gimlichael deleted the v9.1.1/inconvenience-fixes branch April 1, 2025 19:36
@coderabbitai coderabbitai bot mentioned this pull request Apr 3, 2025
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