Skip to content

Commit 50a6863

Browse files
Limit test workers to feature suite
1 parent 554b779 commit 50a6863

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

tests/TestCase.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ abstract class TestCase extends BaseTestCase
2424

2525
public static function setUpBeforeClass(): void
2626
{
27-
if (TestSuiteSubscriber::getCurrentSuite() === 'feature') {
27+
$currentSuite = TestSuiteSubscriber::getCurrentSuite();
28+
29+
if ($currentSuite === 'feature') {
2830
Dotenv::createImmutable(__DIR__, '.env.feature')->safeLoad();
29-
} elseif (TestSuiteSubscriber::getCurrentSuite() === 'unit') {
31+
} elseif ($currentSuite === 'unit') {
3032
Dotenv::createImmutable(__DIR__, '.env.unit')->safeLoad();
3133
}
3234

@@ -37,6 +39,11 @@ public static function setUpBeforeClass(): void
3739
}
3840

3941
self::flushRedis();
42+
43+
if ($currentSuite !== 'feature') {
44+
return;
45+
}
46+
4047
// The first feature test's migrate:fresh runs before setUp() can write
4148
// the Cache facade throttle keys, so prime Redis directly before the
4249
// background queue workers start polling.

0 commit comments

Comments
 (0)