Skip to content

Conversation

@TopSwagCode
Copy link
Owner

No description provided.

@TopSwagCode TopSwagCode requested a review from Copilot January 17, 2026 18:49
@codecov-commenter
Copy link

codecov-commenter commented Jan 17, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.95%. Comparing base (2a9674d) to head (104103b).
⚠️ Report is 1 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #19   +/-   ##
=======================================
  Coverage   77.95%   77.95%           
=======================================
  Files           2        2           
  Lines         186      186           
  Branches       28       28           
=======================================
  Hits          145      145           
  Misses         21       21           
  Partials       20       20           
Flag Coverage Δ
unittests 77.95% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Contributor

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 refactors the test suite for MinimalWorker to improve organization, maintainability, and test coverage. The main change involves breaking down a monolithic TestDependency.cs file into well-organized helper classes, fake implementations, and test types across dedicated namespaces.

Changes:

  • Reorganized test infrastructure by splitting TestDependency.cs into Helpers/, Fakes/, and TestTypes/ folders with properly namespaced classes
  • Introduced TestConstants to replace magic numbers throughout tests, using bounded ranges for execution count assertions
  • Added comprehensive new test cases covering edge cases (zero interval timers, invalid cron expressions, error handler exceptions, builder pattern edge cases)

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/MinimalWorker.Test/TestDependency.cs Removed monolithic test helper file (227 lines deleted)
test/MinimalWorker.Test/Fakes/* Extracted fake services into organized files with improved thread-safety using Interlocked operations
test/MinimalWorker.Test/Helpers/* Created helper utilities (WorkerTestHelper, TestConstants, LoggingTestHelper) for test infrastructure
test/MinimalWorker.Test/TestTypes/WorkerSettings.cs Extracted configuration type for IOptions testing
test/MinimalWorker.Test/*Tests.cs Updated imports and replaced magic numbers with TestConstants; improved assertions with bounded ranges
test/MinimalWorker.Test/BuilderPatternTests.cs New test file covering fluent API edge cases (196 lines)
test/MinimalWorker.Test/PeriodicWorkerTests.cs Added tests for non-overlapping executions and zero interval handling
test/MinimalWorker.Test/TelemetryTests.cs Added tests for cron activity tags and gauge measurements
test/MinimalWorker.Test/ErrorHandlerTests.cs Added tests for error handler exceptions and inner exception preservation
test/MinimalWorker.Test/CronWorkerTests.cs Added tests for error recovery, day-of-week schedules, and invalid expressions
test/MinimalWorker.Test/ContinuousWorkerTests.cs Added test for synchronous work in async context
test/MinimalWorker.Test/ServiceResolutionTests.cs Added test for transient service resolution
.claude/settings.local.json Added Claude desktop permissions for dotnet test and build commands

Comment on lines +89 to +104
var listener = new ActivityListener
{
ShouldListenTo = source => source.Name == "MinimalWorker",
Sample = (ref ActivityCreationOptions<ActivityContext> options) => ActivitySamplingResult.AllData,
ActivityStarted = activity =>
{
lock (activities)
{
activities.Add(activity);
}
if (signalOnFirst)
{
signal.TrySetResult(true);
}
}
};
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

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

Disposable 'ActivityListener' is created but not disposed.

Copilot uses AI. Check for mistakes.
Comment on lines +119 to +134
var listener = new ActivityListener
{
ShouldListenTo = source => source.Name == "MinimalWorker",
Sample = (ref ActivityCreationOptions<ActivityContext> options) => ActivitySamplingResult.AllData,
ActivityStopped = activity =>
{
lock (activities)
{
activities.Add(activity);
}
if (signalCondition == null || signalCondition(activity))
{
signal.TrySetResult(true);
}
}
};
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

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

Disposable 'ActivityListener' is created but not disposed.

Copilot uses AI. Check for mistakes.
@TopSwagCode TopSwagCode merged commit 814198a into master Jan 18, 2026
7 checks passed
@TopSwagCode TopSwagCode deleted the feature/timeprovider branch January 18, 2026 07:19
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.

3 participants