Skip to content

Commit 3d88255

Browse files
[1.x] Redis Support Improvements (#125)
* [1.x] Allow to skip Redis tests when unable to use `redis-cli`. Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * Fix code styling * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * Fix code styling * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip * wip * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * Fix code styling * wip --------- Signed-off-by: Mior Muhammad Zaki <[email protected]> Co-authored-by: crynobone <[email protected]> Co-authored-by: timacdonald <[email protected]> Co-authored-by: Tim MacDonald <[email protected]>
1 parent 03e1c22 commit 3d88255

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
/.github export-ignore
1010
/art export-ignore
1111
/tests export-ignore
12+
/workbench export-ignore
1213
.editorconfig export-ignore
1314
.gitattributes export-ignore
1415
.gitignore export-ignore
1516
CHANGELOG.md export-ignore
1617
phpstan.neon.dist export-ignore
1718
phpunit.xml.dist export-ignore
19+
testbench.yaml export-ignore
1820
UPGRADE.md export-ignore

tests/Feature/RedisTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
use Illuminate\Process\Exceptions\ProcessFailedException;
34
use Illuminate\Support\Facades\App;
45
use Illuminate\Support\Facades\Config;
56
use Illuminate\Support\Facades\Date;
@@ -13,7 +14,13 @@
1314
use Laravel\Pulse\Support\RedisClientException;
1415
use Tests\StorageFake;
1516

16-
beforeEach(fn () => Process::timeout(1)->run('redis-cli -p '.Config::get('database.redis.default.port').' FLUSHALL')->throw());
17+
beforeEach(function () {
18+
try {
19+
Process::timeout(1)->run('redis-cli -p '.Config::get('database.redis.default.port').' FLUSHALL')->throw();
20+
} catch (ProcessFailedException $e) {
21+
$this->markTestSkipped('Unable to run `redis-cli`');
22+
}
23+
});
1724

1825
it('runs the same commands while ingesting entries', function ($driver) {
1926
Config::set('database.redis.client', $driver);

0 commit comments

Comments
 (0)