Skip to content

Commit 0062840

Browse files
committed
[12.x] Skip failing redis cluster tests
1 parent f9c6241 commit 0062840

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

tests/Integration/Cache/MemoizedStoreTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
use Illuminate\Cache\Events\WritingKey;
1414
use Illuminate\Contracts\Cache\Store;
1515
use Illuminate\Foundation\Testing\Concerns\InteractsWithRedis;
16+
use Illuminate\Redis\Connections\PhpRedisClusterConnection;
17+
use Illuminate\Redis\Connections\PredisClusterConnection;
1618
use Illuminate\Support\Facades\Cache;
1719
use Illuminate\Support\Facades\Config;
1820
use Illuminate\Support\Facades\Event;
@@ -31,6 +33,12 @@ protected function setUp(): void
3133

3234
$this->setUpRedis();
3335

36+
$connection = $this->app['redis']->connection();
37+
$this->markTestSkippedWhen(
38+
$connection instanceof PhpRedisClusterConnection || $connection instanceof PredisClusterConnection,
39+
'flushAll currently not supported for Redis Cluster connections',
40+
);
41+
3442
Config::set('cache.default', 'redis');
3543
Redis::flushAll();
3644
}

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 some other on Redis Cluster cluster connections',
31+
);
2532
});
2633

2734
$this->beforeApplicationDestroyed(function () {

0 commit comments

Comments
 (0)