From b12bee51b0f5997ada345269e7b6028b592e5e48 Mon Sep 17 00:00:00 2001 From: Durable Workflow Swarm Date: Mon, 2 Nov 2026 02:44:13 -0600 Subject: [PATCH] ci: run the DST schedule regression in the PR unit contracts The daylight saving unit test now calls WorkflowSchedule::nextCronOccurrence() directly and extends PHPUnit's TestCase, so the database-independent PR unit-contract slice can run it. Refs #882 Co-Authored-By: Claude Opus 5.5 --- .github/pr-test-selection.json | 1 + .../Unit/V2/WorkflowScheduleDaylightSavingTest.php | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/pr-test-selection.json b/.github/pr-test-selection.json index f3e329153..e329aa8c4 100644 --- a/.github/pr-test-selection.json +++ b/.github/pr-test-selection.json @@ -26,6 +26,7 @@ "tests/Unit/V2/WorkflowFiberRunnerTest.php", "tests/Unit/V2/WorkflowHistoryPayloadCastTest.php", "tests/Unit/V2/WorkflowInstanceIdTest.php", + "tests/Unit/V2/WorkflowScheduleDaylightSavingTest.php", "tests/Unit/V2/WorkflowStepHistoryTest.php" ], "mysql_smoke": [ diff --git a/tests/Unit/V2/WorkflowScheduleDaylightSavingTest.php b/tests/Unit/V2/WorkflowScheduleDaylightSavingTest.php index 65a27ef66..2ae92af6f 100644 --- a/tests/Unit/V2/WorkflowScheduleDaylightSavingTest.php +++ b/tests/Unit/V2/WorkflowScheduleDaylightSavingTest.php @@ -8,8 +8,8 @@ use DateTimeZone; use Illuminate\Support\Carbon; use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use ReflectionMethod; -use Tests\TestCase; use Workflow\V2\Models\WorkflowSchedule; /** @@ -141,14 +141,12 @@ public function testCronOccurrencesFollowDaylightSavingRules( string $startUtc, array $expected, ): void { - $schedule = new WorkflowSchedule(); - $schedule->spec = [ - 'cron_expressions' => [$expression], - 'timezone' => $timezone, - ]; - $this->assertSame($expected, $this->occurrences( - static fn (DateTimeInterface $after): ?DateTimeInterface => $schedule->computeNextFireAt($after), + static fn (DateTimeInterface $after): ?DateTimeInterface => WorkflowSchedule::nextCronOccurrence( + $expression, + $after, + $timezone + ), $startUtc, count($expected), ));