-
Notifications
You must be signed in to change notification settings - Fork 0
V4.0.0/additional functional testing #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe changes introduce breaking changes by removing key extension classes and methods from the Codebelt.Bootstrapper namespaces. Several release and changelog notes are updated to flag these alterations. In addition, the solution now includes new projects for Worker and Web Functional Tests. Several test fixtures have been removed or modified, with some classes’ inheritance updated. New test classes and startup files were added to both the Web and Worker test suites. A package version bump also reflects dependency updates, while some code has been refactored purely for clarity. Changes
Sequence Diagram(s)sequenceDiagram
participant Test as MinimalWebProgramTest
participant Factory as MinimalWebHostTestFactory
participant WebApp as WebApplication
participant Endpoint as "/" Endpoint
Test->>Factory: Create test host with configuration
Factory->>WebApp: Setup services & middleware
WebApp->>Endpoint: Define endpoint returning "Hello World!"
Test->>WebApp: Send request
WebApp-->>Test: Return "Hello World!"
sequenceDiagram
participant Test as MinimalWorkerProgramTest
participant Factory as MinimalHostTestFactory
participant Worker as Worker Host
participant Fake as FakeHostedService
Test->>Factory: Configure worker host with logging and FakeHostedService
Factory->>Worker: Start worker host
Worker->>Fake: Invoke ExecuteAsync
Fake->>Worker: Log lifecycle events (start, iteration, stopping, stopped)
Worker-->>Test: Provide logged output for assertions
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 17 out of 21 changed files in this pull request and generated 1 comment.
Files not reviewed (4)
- Codebelt.Bootstrapper.sln: Language not supported
- Directory.Packages.props: Language not supported
- test/Codebelt.Bootstrapper.Web.FunctionalTests/Codebelt.Bootstrapper.Web.FunctionalTests.csproj: Language not supported
- test/Codebelt.Bootstrapper.Worker.FunctionalTests/Codebelt.Bootstrapper.Worker.FunctionalTests.csproj: Language not supported
Comments suppressed due to low confidence (1)
src/Codebelt.Bootstrapper.Web/MinimalWebProgram.cs:18
- [nitpick] The variable name 'hb' is ambiguous; consider renaming it to 'builder' or 'appBuilder' for better clarity.
var hb = WebApplication.CreateBuilder(args);
events.OnApplicationStoppingCallback = () => | ||
{ | ||
_gracefulShutdown = true; | ||
logger.LogWarning("Stopping and cleaning .."); | ||
Thread.Sleep(TimeSpan.FromMilliseconds(125)); // simulate graceful shutdown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Thread.Sleep in an asynchronous context may block the thread unnecessarily. Consider replacing it with an asynchronous delay (e.g., await Task.Delay(125, stoppingToken)) to avoid potential issues in async scenarios.
events.OnApplicationStoppingCallback = () => | |
{ | |
_gracefulShutdown = true; | |
logger.LogWarning("Stopping and cleaning .."); | |
Thread.Sleep(TimeSpan.FromMilliseconds(125)); // simulate graceful shutdown | |
events.OnApplicationStoppingCallback = async () => | |
{ | |
_gracefulShutdown = true; | |
logger.LogWarning("Stopping and cleaning .."); | |
await Task.Delay(TimeSpan.FromMilliseconds(125)); // simulate graceful shutdown |
Copilot uses AI. Check for mistakes.
There was a problem hiding this 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 (5)
test/Codebelt.Bootstrapper.Web.FunctionalTests/Assets/TestStartup.cs (1)
16-18
: Consider whether an empty ConfigureServices method override is necessary.The method is overridden but doesn't add any services. If no customization is needed, consider removing this override to reduce unnecessary code.
test/Codebelt.Bootstrapper.Worker.FunctionalTests/Assets/FakeHostedService.cs (4)
1-9
: Remove unused namespaces.There are several unused namespaces being imported that can be removed.
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks;
14-17
: Consider specifying a type parameter for TaskCompletionSource.While this works in newer .NET versions, explicitly specifying the type parameter improves code clarity and backward compatibility.
- private readonly TaskCompletionSource _tsc = new(); + private readonly TaskCompletionSource<object> _tsc = new();
28-34
: Replace Thread.Sleep with asynchronous Task.Delay in the shutdown callback.Using Thread.Sleep blocks the thread, which is generally not recommended. Consider using Task.Delay for non-blocking delay, even in test code.
events.OnApplicationStoppingCallback = () => { _gracefulShutdown = true; logger.LogWarning("Stopping and cleaning .."); - Thread.Sleep(TimeSpan.FromMilliseconds(125)); // simulate graceful shutdown + // Note: If you need this to be synchronous, keep Thread.Sleep + // Otherwise, consider Task.Delay which would make this method async + // await Task.Delay(TimeSpan.FromMilliseconds(125), CancellationToken.None); logger.LogWarning(".. done!"); };Since this is test code simulating a cleanup operation, the synchronous approach might be intentional, but it's worth considering the asynchronous alternative.
46-46
: Add braces to single-line if statement for better readability.While single-line if statements without braces are valid, adding braces improves code consistency and reduces the risk of future bugs if more statements are added.
- if (_gracefulShutdown) { return; } + if (_gracefulShutdown) + { + return; + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (21)
.nuget/Codebelt.Bootstrapper.Web/PackageReleaseNotes.txt
(1 hunks)CHANGELOG.md
(1 hunks)Codebelt.Bootstrapper.sln
(3 hunks)Directory.Packages.props
(1 hunks)src/Codebelt.Bootstrapper.Web/MinimalWebProgram.cs
(1 hunks)src/Codebelt.Bootstrapper.Web/WebApplicationBuilderExtensions.cs
(0 hunks)test/Codebelt.Bootstrapper.Console.FunctionalTests/Assets/ManualGenericHostFixture.cs
(0 hunks)test/Codebelt.Bootstrapper.Console.FunctionalTests/Assets/ManualMinimalHostFixture.cs
(0 hunks)test/Codebelt.Bootstrapper.Console.FunctionalTests/Assets/TestHostFixture.cs
(1 hunks)test/Codebelt.Bootstrapper.Console.FunctionalTests/LoggerExtensions.cs
(0 hunks)test/Codebelt.Bootstrapper.Console.FunctionalTests/MinimalConsoleHostedServiceTest.cs
(1 hunks)test/Codebelt.Bootstrapper.FunctionalTests/Assets/TestHostFixture.cs
(1 hunks)test/Codebelt.Bootstrapper.Web.FunctionalTests/Assets/TestStartup.cs
(1 hunks)test/Codebelt.Bootstrapper.Web.FunctionalTests/Codebelt.Bootstrapper.Web.FunctionalTests.csproj
(1 hunks)test/Codebelt.Bootstrapper.Web.FunctionalTests/MinimalWebProgramTest.cs
(1 hunks)test/Codebelt.Bootstrapper.Web.FunctionalTests/WebStartupTest.cs
(1 hunks)test/Codebelt.Bootstrapper.Worker.FunctionalTests/Assets/FakeHostedService.cs
(1 hunks)test/Codebelt.Bootstrapper.Worker.FunctionalTests/Assets/TestStartup.cs
(1 hunks)test/Codebelt.Bootstrapper.Worker.FunctionalTests/Codebelt.Bootstrapper.Worker.FunctionalTests.csproj
(1 hunks)test/Codebelt.Bootstrapper.Worker.FunctionalTests/MinimalWorkerProgramTest.cs
(1 hunks)test/Codebelt.Bootstrapper.Worker.FunctionalTests/WorkerStartupTest.cs
(1 hunks)
💤 Files with no reviewable changes (4)
- test/Codebelt.Bootstrapper.Console.FunctionalTests/Assets/ManualGenericHostFixture.cs
- test/Codebelt.Bootstrapper.Console.FunctionalTests/Assets/ManualMinimalHostFixture.cs
- test/Codebelt.Bootstrapper.Console.FunctionalTests/LoggerExtensions.cs
- src/Codebelt.Bootstrapper.Web/WebApplicationBuilderExtensions.cs
🧰 Additional context used
🧬 Code Graph Analysis (5)
test/Codebelt.Bootstrapper.Web.FunctionalTests/Assets/TestStartup.cs (1)
test/Codebelt.Bootstrapper.Worker.FunctionalTests/Assets/TestStartup.cs (3)
TestStartup
(7-17)TestStartup
(9-11)ConfigureServices
(13-16)
test/Codebelt.Bootstrapper.Console.FunctionalTests/Assets/TestHostFixture.cs (1)
test/Codebelt.Bootstrapper.FunctionalTests/Assets/TestHostFixture.cs (1)
TestHostFixture
(9-34)
test/Codebelt.Bootstrapper.Worker.FunctionalTests/WorkerStartupTest.cs (2)
test/Codebelt.Bootstrapper.Worker.FunctionalTests/Assets/FakeHostedService.cs (3)
Task
(40-51)FakeHostedService
(12-52)FakeHostedService
(19-38)test/Codebelt.Bootstrapper.Worker.FunctionalTests/Assets/TestStartup.cs (2)
TestStartup
(7-17)TestStartup
(9-11)
test/Codebelt.Bootstrapper.Web.FunctionalTests/MinimalWebProgramTest.cs (3)
test/Codebelt.Bootstrapper.Worker.FunctionalTests/MinimalWorkerProgramTest.cs (1)
Fact
(21-50)test/Codebelt.Bootstrapper.Web.FunctionalTests/WebStartupTest.cs (1)
Fact
(20-39)test/Codebelt.Bootstrapper.Worker.FunctionalTests/WorkerStartupTest.cs (1)
Fact
(21-50)
test/Codebelt.Bootstrapper.FunctionalTests/Assets/TestHostFixture.cs (1)
test/Codebelt.Bootstrapper.Console.FunctionalTests/Assets/TestHostFixture.cs (1)
TestHostFixture
(9-34)
🪛 ast-grep (0.31.1)
test/Codebelt.Bootstrapper.Web.FunctionalTests/Assets/TestStartup.cs
[warning] 23-23: Stacktrace information is displayed in a non-Development environment. Accidentally disclosing sensitive stack trace information in a production environment aids an attacker in reconnaissance and information gathering.
Context: app.UseDeveloperExceptionPage();
Note: [CWE-209] Generation of Error Message Containing Sensitive Information. [REFERENCES]
(stacktrace-disclosure-csharp)
test/Codebelt.Bootstrapper.Web.FunctionalTests/MinimalWebProgramTest.cs
[warning] 28-28: Stacktrace information is displayed in a non-Development environment. Accidentally disclosing sensitive stack trace information in a production environment aids an attacker in reconnaissance and information gathering.
Context: app.UseDeveloperExceptionPage();
Note: [CWE-209] Generation of Error Message Containing Sensitive Information. [REFERENCES]
(stacktrace-disclosure-csharp)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: 🧪 Test (windows-2022, Release)
- GitHub Check: 🧪 Test (windows-2022, Debug)
- GitHub Check: 🧪 Test (ubuntu-24.04, Debug)
- GitHub Check: 📦 Pack (Debug)
- GitHub Check: 📦 Pack (Release)
- GitHub Check: 🧪 Test (ubuntu-24.04, Release)
🔇 Additional comments (25)
src/Codebelt.Bootstrapper.Web/MinimalWebProgram.cs (1)
18-20
: Code refactoring improves readability.The refactoring of
CreateHostBuilder
method improves readability by separating the creation and configuration of the WebApplicationBuilder into discrete steps, which aligns with the PR objectives. This change maintains the same functionality while making the code more explicit and easier to understand.This change appears to be related to the mentioned breaking change where
WebApplicationBuilderExtensions
class has been removed. Verify that theUseBootstrapperLifetime
extension method is correctly made available in this context and that all required using directives are in place.CHANGELOG.md (1)
25-25
: Breaking change properly documentedThis addition to the changelog clearly documents the removal of the
WebApplicationBuilderExtensions
class as a breaking change, which aligns with the PR objectives. Well-documented breaking changes help users understand that they'll need to update their code..nuget/Codebelt.Bootstrapper.Web/PackageReleaseNotes.txt (1)
7-9
: Detailed breaking change documentationGood addition of a dedicated "Breaking Changes" section that clearly specifies not just the removal of the class but also mentions the extension method (
UseBootstrapperLifetime
) that was provided by it. This level of detail helps users understand exactly what they need to modify in their code.test/Codebelt.Bootstrapper.Console.FunctionalTests/Assets/TestHostFixture.cs (1)
9-9
:✅ Verification successful
Base class updated for test fixture
The inheritance change from
GenericHostFixture
toManagedHostFixture
aligns with the PR objective of refactoring and improving test coverage. This change maintains the sameConfigureHost
implementation while potentially leveraging new functionality from the updated base class.
🏁 Script executed:
#!/bin/bash # Check what additional functionality or differences exist between the old and new base classes echo "Searching for GenericHostFixture class definition..." rg -A 3 "class GenericHostFixture" --type csharp echo "Searching for ManagedHostFixture class definition..." rg -A 3 "class ManagedHostFixture" --type csharp echo "Searching for other classes that inherit from ManagedHostFixture..." rg "class \w+ : ManagedHostFixture" --type csharpLength of output: 782
Verified: Test fixture now properly inherits from ManagedHostFixture
The inheritance update from
GenericHostFixture
toManagedHostFixture
is confirmed and aligns with the PR’s refactoring objectives. Our investigation shows that:
- References to the old
GenericHostFixture
are no longer present in the codebase.- Both test fixture implementations (in
test/Codebelt.Bootstrapper.Console.FunctionalTests/Assets/TestHostFixture.cs
and similar locations) are correctly updated to inherit fromManagedHostFixture
.No further adjustments are necessary.
test/Codebelt.Bootstrapper.FunctionalTests/Assets/TestHostFixture.cs (1)
9-9
: Consistent base class update across test projectsThis inheritance change mirrors the one made in the Console.FunctionalTests project, demonstrating a systematic approach to updating test fixtures. This consistency is important for maintaining a cohesive testing framework across the entire codebase.
test/Codebelt.Bootstrapper.Web.FunctionalTests/Assets/TestStartup.cs (2)
8-14
: Good implementation of TestStartup class extending WebStartup.The constructor properly passes the configuration and environment parameters to the base class while keeping its own implementation minimal.
20-36
:✅ Verification successful
Good implementation of the ConfigurePipeline method.
The method correctly:
- Uses developer exception page only in local development
- Sets up routing
- Configures a simple endpoint that returns "Hello World!"
This provides a good test setup for functional testing of the Web pipeline.
Verify that the
IsLocalDevelopment()
extension method provides equivalent protection as the standardIsDevelopment()
:
🏁 Script executed:
#!/bin/bash # Check implementation of IsLocalDevelopment vs IsDevelopment rg -A 5 -B 5 "IsLocalDevelopment" --type csharpLength of output: 8424
CodePipeline Functional Test Setup Approved – No Issues Found
The
ConfigurePipeline
method intest/Codebelt.Bootstrapper.Web.FunctionalTests/Assets/TestStartup.cs
is implemented correctly. The method:
- Enables the developer exception page conditionally using
Environment.IsLocalDevelopment()
, which is consistently applied across the repository, mirroring the behavior of the standardIsDevelopment()
method.- Sets up routing.
- Configures an endpoint that returns "Hello World!" for functional testing.
Based on the verification output, the usage of
IsLocalDevelopment()
aligns with how it's implemented in other startup classes. No further changes are required.🧰 Tools
🪛 ast-grep (0.31.1)
[warning] 23-23: Stacktrace information is displayed in a non-Development environment. Accidentally disclosing sensitive stack trace information in a production environment aids an attacker in reconnaissance and information gathering.
Context: app.UseDeveloperExceptionPage();
Note: [CWE-209] Generation of Error Message Containing Sensitive Information. [REFERENCES](stacktrace-disclosure-csharp)
test/Codebelt.Bootstrapper.Console.FunctionalTests/MinimalConsoleHostedServiceTest.cs (1)
1-43
: Clean and focused test implementation.The test creates a minimal host, executes it, and verifies the expected log messages were produced in the correct order. This provides good coverage for the bootstrapper lifecycle functionality.
test/Codebelt.Bootstrapper.Worker.FunctionalTests/Assets/TestStartup.cs (2)
7-11
: Good implementation of TestStartup class extending WorkerStartup.The constructor correctly passes configuration and environment parameters to the base class.
13-16
:✅ Verification successful
Appropriate service configuration for worker testing.
The method correctly adds the FakeHostedService to the service collection, which will be essential for testing the worker functionality.
Let's verify the FakeHostedService implementation:
🏁 Script executed:
#!/bin/bash # Check FakeHostedService implementation rg -A 15 "class FakeHostedService" --type csharpLength of output: 5205
Verified: Service configuration and FakeHostedService implementation are correctly set up
The configuration in
test/Codebelt.Bootstrapper.Worker.FunctionalTests/Assets/TestStartup.cs
properly registers theFakeHostedService
for background processing. Verification shows that the test version ofFakeHostedService
(in the corresponding test assets folder) logs startup events and uses aTaskCompletionSource
to signal readiness, which meets our testing requirements.No further changes are needed.
test/Codebelt.Bootstrapper.Web.FunctionalTests/WebStartupTest.cs (2)
14-18
: Well-structured test class definition.The class properly inherits from Test and includes a constructor that accepts ITestOutputHelper for logging.
20-39
: Good implementation of web application test.The test correctly:
- Sets up a test server with appropriate configuration
- Uses the TestStartup class for application setup
- Retrieves and validates the response content
This provides effective functional testing for the web application pipeline.
One note: The test explicitly enables
PreserveExecutionContext = true
on line 31, which is important for async operations in test scenarios. This is a good practice to ensure accurate test behavior.Codebelt.Bootstrapper.sln (2)
50-53
: Added new functional test projectsThe addition of the Worker and Web functional test projects aligns well with the PR objectives to improve test coverage. This follows good practice of having dedicated test projects for different application types.
136-143
: Correctly configured build settings for new test projectsThe solution file updates include all necessary configuration entries for the new projects, with proper build configurations and solution folder organization.
Also applies to: 168-169
test/Codebelt.Bootstrapper.Web.FunctionalTests/MinimalWebProgramTest.cs (3)
11-18
: Well-structured test class implementationThe test class follows proper inheritance patterns and constructor design for XUnit testing. The structure makes it easy to add additional test methods in the future.
27-30
: Developer exception page properly guarded by environment checkThe developer exception page is correctly configured to only be used in the local development environment, which prevents sensitive stack trace information from being exposed in production environments.
🧰 Tools
🪛 ast-grep (0.31.1)
[warning] 28-28: Stacktrace information is displayed in a non-Development environment. Accidentally disclosing sensitive stack trace information in a production environment aids an attacker in reconnaissance and information gathering.
Context: app.UseDeveloperExceptionPage();
Note: [CWE-209] Generation of Error Message Containing Sensitive Information. [REFERENCES](stacktrace-disclosure-csharp)
19-49
:✅ Verification successful
Functional test for minimal web application follows best practices
The test correctly simulates a minimal web application using appropriate test factory methods, properly configures services and middleware, and verifies the expected output.
I noticed the use of
IsLocalDevelopment()
instead of the more commonIsDevelopment()
. Could you verify this is intentional and that this extension method works as expected in the test environment?
🏁 Script executed:
#!/bin/bash # Look for the definition of IsLocalDevelopment extension method rg -A 3 "IsLocalDevelopment" --type csharpLength of output: 3240
Verified: The usage of
IsLocalDevelopment()
is intentional and functioning as expected.After reviewing the codebase, multiple files—including production and test projects—consistently use
IsLocalDevelopment()
(e.g., inapp/Codebelt.Bootstrapper.Web.App/Startup.cs
and others), confirming that this custom extension method is the deliberate choice for environment checking in our projects. The minimal web application test intest/Codebelt.Bootstrapper.Web.FunctionalTests/MinimalWebProgramTest.cs
accurately leverages this method, so no changes are required.🧰 Tools
🪛 ast-grep (0.31.1)
[warning] 28-28: Stacktrace information is displayed in a non-Development environment. Accidentally disclosing sensitive stack trace information in a production environment aids an attacker in reconnaissance and information gathering.
Context: app.UseDeveloperExceptionPage();
Note: [CWE-209] Generation of Error Message Containing Sensitive Information. [REFERENCES](stacktrace-disclosure-csharp)
test/Codebelt.Bootstrapper.Worker.FunctionalTests/MinimalWorkerProgramTest.cs (2)
13-19
: Well-structured worker test class designThe test class follows proper inheritance and constructor injection patterns, providing a good foundation for testing the worker functionality.
21-50
: Comprehensive test for the minimal worker application lifecycleThis test successfully validates the complete lifecycle of a worker service:
- Proper host setup and configuration with
MinimalHostTestFactory
- Service registration including test logging and the fake hosted service
- Host startup and graceful shutdown
- Verification of all expected log messages throughout the service lifecycle
The assertions correctly check for the exact sequence of log messages, providing thorough validation of the worker's behavior.
test/Codebelt.Bootstrapper.Worker.FunctionalTests/WorkerStartupTest.cs (2)
13-19
: Consistent test class designThe test class follows the same design pattern as other test classes in the project, maintaining consistency in the testing approach.
21-50
: Well-implemented worker service test with startup configurationThis test effectively validates the worker service when using the traditional Startup class pattern:
- Configures the host with
HostTestFactory
and appropriate services- Uses
UseBootstrapperStartup<TestStartup>
to register the startup class- Implements proper async patterns for host startup and shutdown
- Performs thorough validation of log messages to ensure correct behavior
The test demonstrates how the bootstrapper framework supports both minimal and startup-based configurations.
test/Codebelt.Bootstrapper.Worker.FunctionalTests/Assets/FakeHostedService.cs (1)
12-52
: Overall implementation of the FakeHostedService looks good.The service correctly implements the BackgroundService pattern and properly handles application lifecycle events through the IHostLifetimeEvents interface. It includes appropriate logging at each stage and demonstrates both graceful shutdown and cancellation handling.
Directory.Packages.props (1)
7-7
: Package version update looks good.The update from
10.0.0-preview.2
to10.0.0-preview.3
for theCodebelt.Extensions.Xunit.App
package aligns with the dependency updates mentioned in the PR objectives.test/Codebelt.Bootstrapper.Web.FunctionalTests/Codebelt.Bootstrapper.Web.FunctionalTests.csproj (1)
1-11
:❓ Verification inconclusive
New functional test project looks good.
The addition of this new functional test project matches the PR objectives which mention introducing new test projects for
Codebelt.Bootstrapper.Web
.Are test package references defined elsewhere? The project file doesn't directly reference testing packages like xUnit which were mentioned in the package updates. You might want to verify these dependencies are properly inherited from a central configuration or add them explicitly.
🏁 Script executed:
#!/bin/bash # Check if test packages are referenced in other project files find . -name "*.csproj" -exec grep -l "Include=\"xunit\"" {} \; find . -name "*.csproj" -exec grep -l "Include=\"Microsoft.NET.Test.Sdk\"" {} \;Length of output: 150
Below is an updated review comment that calls for further verification of how test packages are managed:
Verify Centralized Test Package Inheritance
The new functional test project looks good and meets the PR objectives. However, the project file itself doesn’t list explicit references for test packages (such as xUnit and Microsoft.NET.Test.Sdk). Please verify that these dependencies are being inherited via a central configuration (e.g., through a centralized file like Directory.Packages.props or Directory.Build.props). If they are not inherited, you may need to add the references explicitly.
To help with the verification, please run the script below at the root of your repository. This script checks for central configuration files and looks for the test package references:
#!/bin/bash # Check for central package management files that may define test package dependencies. for file in Directory.Packages.props Directory.Build.props; do if [ -f "$file" ]; then echo "Found $file:" grep -E "xunit|Microsoft\.NET\.Test\.Sdk" "$file" || echo "No test package reference found in $file" else echo "$file not found." fi donePlease review the results to ensure that the test package dependencies are properly inherited. If not, consider adding them explicitly in the test project or in the central configuration.
test/Codebelt.Bootstrapper.Worker.FunctionalTests/Codebelt.Bootstrapper.Worker.FunctionalTests.csproj (1)
1-11
:❓ Verification inconclusive
New functional test project looks good.
The addition of this functional test project aligns with the PR objectives which specifically mention introducing new test projects for both
Codebelt.Bootstrapper.Worker
andCodebelt.Bootstrapper.Web
.Similar to the Web test project, this project doesn't directly reference testing packages. Consider verifying that test dependencies are properly inherited or adding them explicitly if needed.
🏁 Script executed:
#!/bin/bash # Check if there's a common test infrastructure project or directory find . -type d -name "*Test*" | grep -v "FunctionalTests" # Check if there are any Directory.Build.props files that might define common test settings find . -name "Directory.Build.props"Length of output: 153
Review on New Functional Test Project Setup
- The new functional test project for Codebelt.Bootstrapper.Worker is aligned with the PR objectives and looks good overall.
- Note that, as with the Web test project, this project doesn’t directly reference testing packages. Please verify that the necessary test dependencies are being inherited from the common configuration. Our repository shows a shared test directory (
./test/Codebelt.Bootstrapper.Tests
) and aDirectory.Build.props
file in the root, which likely contain the common test infrastructure settings.- Ensure that these global settings properly supply the required packages (e.g., NUnit, xUnit, etc.) to avoid any missing dependency issues in the future.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10 +/- ##
=======================================
Coverage ? 77.96%
=======================================
Files ? 19
Lines ? 236
Branches ? 16
=======================================
Hits ? 184
Misses ? 52
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This pull request includes several changes to the
Codebelt.Bootstrapper
project, focusing on breaking changes, new test projects, and dependency updates. Below are the most important changes grouped by theme:Breaking Changes:
WebApplicationBuilderExtensions
class in theCodebelt.Bootstrapper.Web
namespace. TheUseBootstrapperLifetime
extension method should now be used directly. (.nuget/Codebelt.Bootstrapper.Web/PackageReleaseNotes.txt
- [1]CHANGELOG.md
- [2]New Test Projects:
Codebelt.Bootstrapper.Worker
andCodebelt.Bootstrapper.Web
. (Codebelt.Bootstrapper.sln
- [1] [2] [3]TestStartup
andMinimalWebProgramTest
classes to theCodebelt.Bootstrapper.Web.FunctionalTests
project. (test/Codebelt.Bootstrapper.Web.FunctionalTests/Assets/TestStartup.cs
- [1]test/Codebelt.Bootstrapper.Web.FunctionalTests/MinimalWebProgramTest.cs
- [2]FakeHostedService
andTestStartup
classes to theCodebelt.Bootstrapper.Worker.FunctionalTests
project. (test/Codebelt.Bootstrapper.Worker.FunctionalTests/Assets/FakeHostedService.cs
- [1]test/Codebelt.Bootstrapper.Worker.FunctionalTests/Assets/TestStartup.cs
- [2]Dependency Updates:
Codebelt.Extensions.Xunit.App
package to version10.0.0-preview.3
in theDirectory.Packages.props
file. (Directory.Packages.props
- Directory.Packages.propsL7-R7)Code Refactoring:
MinimalWebProgram
class to improve readability by separating the creation and configuration of theWebApplicationBuilder
. (src/Codebelt.Bootstrapper.Web/MinimalWebProgram.cs
- src/Codebelt.Bootstrapper.Web/MinimalWebProgram.csL18-R20)Codebelt.Bootstrapper.Console.FunctionalTests
project. (test/Codebelt.Bootstrapper.Console.FunctionalTests/Assets/ManualGenericHostFixture.cs
- [1]test/Codebelt.Bootstrapper.Console.FunctionalTests/Assets/ManualMinimalHostFixture.cs
- [2]test/Codebelt.Bootstrapper.Console.FunctionalTests/LoggerExtensions.cs
- [3]These changes aim to streamline the codebase, improve test coverage, and ensure compatibility with the latest dependencies.
Summary by CodeRabbit
Breaking Changes
Tests
Chores