Skip to content

Commit 8f7d979

Browse files
committed
[12.x] Skip failing redis cluster tests
1 parent ab46b38 commit 8f7d979

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

tests/Integration/Cache/MemoizedStoreTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
use Illuminate\Cache\Events\RetrievingKey;
1212
use Illuminate\Cache\Events\RetrievingManyKeys;
1313
use Illuminate\Cache\Events\WritingKey;
14+
use Illuminate\Cache\MemoizedStore;
1415
use Illuminate\Contracts\Cache\Store;
1516
use Illuminate\Foundation\Testing\Concerns\InteractsWithRedis;
17+
use Illuminate\Redis\Connections\PhpRedisClusterConnection;
18+
use Illuminate\Redis\Connections\PredisClusterConnection;
1619
use Illuminate\Support\Facades\Cache;
1720
use Illuminate\Support\Facades\Config;
1821
use Illuminate\Support\Facades\Event;
@@ -31,6 +34,12 @@ protected function setUp(): void
3134

3235
$this->setUpRedis();
3336

37+
$connection = $this->app['redis']->connection();
38+
$this->markTestSkippedWhen(
39+
$connection instanceof PhpRedisClusterConnection || $connection instanceof PredisClusterConnection,
40+
'MemoizedStore currently does not support Redis Cluster connections',
41+
);
42+
3443
Config::set('cache.default', 'redis');
3544
Redis::flushAll();
3645
}

tests/Integration/Cache/PhpRedisCacheLockTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace Illuminate\Tests\Integration\Cache;
44

55
use Illuminate\Foundation\Testing\Concerns\InteractsWithRedis;
6+
use Illuminate\Redis\Connections\PhpRedisClusterConnection;
7+
use Illuminate\Redis\Connections\PhpRedisConnection;
68
use Illuminate\Support\Facades\Cache;
79
use Orchestra\Testbench\TestCase;
810
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
@@ -17,6 +19,12 @@ protected function setUp(): void
1719
parent::setUp();
1820

1921
$this->setUpRedis();
22+
23+
$connection = $this->app['redis']->connection();
24+
$this->markTestSkippedUnless(
25+
$connection instanceof PhpRedisConnection || $connection instanceof PhpRedisClusterConnection,
26+
'This test is for phpredis only',
27+
);
2028
}
2129

2230
protected function tearDown(): void
@@ -210,7 +218,6 @@ public function testRedisLockCanBeAcquiredAndReleasedWithLz4Compression()
210218
$this->markTestSkipped('Redis extension is not configured to support the lz4 compression.');
211219
}
212220

213-
$this->app['config']->set('database.redis.client', 'phpredis');
214221
$this->app['config']->set('cache.stores.redis.connection', 'default');
215222
$this->app['config']->set('cache.stores.redis.lock_connection', 'default');
216223

tests/Integration/Cache/RedisStoreTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Cache\RedisStore;
77
use Illuminate\Foundation\Testing\Concerns\InteractsWithRedis;
88
use Illuminate\Redis\Connections\PhpRedisClusterConnection;
9+
use Illuminate\Redis\Connections\PredisClusterConnection;
910
use Illuminate\Support\Facades\Cache;
1011
use Illuminate\Support\Facades\Redis;
1112
use Illuminate\Support\Sleep;
@@ -22,6 +23,12 @@ protected function setUp(): void
2223
{
2324
$this->afterApplicationCreated(function () {
2425
$this->setUpRedis();
26+
27+
$connection = $this->app['redis']->connection();
28+
$this->markTestSkippedWhen(
29+
$connection instanceof PhpRedisClusterConnection || $connection instanceof PredisClusterConnection,
30+
'RedisStore currently does not support tags, many and on Redis Cluster cluster connections',
31+
);
2532
});
2633

2734
$this->beforeApplicationDestroyed(function () {

0 commit comments

Comments
 (0)