test: cover SchedulerConfigurationBuilder ScheduleFunc lambdas#53
Merged
test: cover SchedulerConfigurationBuilder ScheduleFunc lambdas#53
Conversation
…nc lambdas to cover the Schedule / ScheduleOnce / Include closure bodies
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
This PR is included in version 1.29.0 |
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.
Summary
The lambdas inside `SchedulerConfigurationBuilder.Schedule<,,>`, `ScheduleOnce<,,>`, and `Include<,,>` (the closures that capture the train's generic type parameters and route to the matching `ITraxScheduler` method) were never invoked in the existing config-only builder tests, leaving each closure body uncovered.
This PR builds a configuration via the public surface, then invokes the resulting `PendingManifest.ScheduleFunc` against an NSubstitute `ITraxScheduler` and verifies the call routes to the expected scheduler method with the captured arguments. Three closures covered: `Schedule` → `ScheduleAsync`, `ScheduleOnce` → `ScheduleOnceAsync`, `Include` → `ScheduleDependentAsync`.
NSubstitute is added as a test-project dependency (already in use in the rest of the workspace).
The remaining gaps to 95% line coverage are in postgres-backed polling services and junctions (EnqueueJobsJunction, ManifestManagerPollingService, DataContextExtensions, JobRunnerExtensions endpoint lambdas) which need full DB-backed integration scaffolding.
Test plan