test heavy workload spreading
This commit is contained in:
parent
becd7573c6
commit
85e2c33c31
2 changed files with 35 additions and 7 deletions
|
|
@ -60,6 +60,27 @@ class EvenDistributionSchedulerTest extends TestCase
|
|||
}
|
||||
}
|
||||
|
||||
public function test_it_spreads_heavier_days_across_the_full_range(): void
|
||||
{
|
||||
$scheduler = new EvenDistributionScheduler;
|
||||
$expectedCounts = [
|
||||
11 => [2, 2, 3, 2, 2],
|
||||
12 => [3, 2, 2, 2, 3],
|
||||
13 => [3, 2, 3, 2, 3],
|
||||
];
|
||||
|
||||
foreach ($expectedCounts as $assignmentCount => $dailyCounts) {
|
||||
$dates = $scheduler->scheduledDates(
|
||||
assignmentCount: $assignmentCount,
|
||||
startDate: $this->utc('2026-08-10'),
|
||||
targetDate: $this->utc('2026-08-14'),
|
||||
workloadPlacement: WorkloadPlacement::Spread,
|
||||
);
|
||||
|
||||
$this->assertSame($dailyCounts, $this->dailyCounts($dates));
|
||||
}
|
||||
}
|
||||
|
||||
public function test_it_places_sparse_assignments_at_the_requested_position(): void
|
||||
{
|
||||
$scheduler = new EvenDistributionScheduler;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue