Skip to content

Commit c8d03e7

Browse files
committed
[12.x] mark certain tests skipped in RedisStoreTest
1 parent 5e417e9 commit c8d03e7

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

tests/Integration/Cache/RedisStoreTest.php

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Illuminate\Redis\Connections\PhpRedisClusterConnection;
99
use Illuminate\Redis\Connections\PredisClusterConnection;
1010
use Illuminate\Support\Facades\Cache;
11-
use Illuminate\Support\Facades\Redis;
1211
use Illuminate\Support\Sleep;
1312
use Mockery as m;
1413
use Orchestra\Testbench\TestCase;
@@ -23,12 +22,6 @@ protected function setUp(): void
2322
{
2423
$this->afterApplicationCreated(function () {
2524
$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-
);
3225
});
3326

3427
$this->beforeApplicationDestroyed(function () {
@@ -103,6 +96,8 @@ public function testItCanExpireWithZeroTTL()
10396

10497
public function testTagsCanBeAccessed()
10598
{
99+
$this->markTestSkippedWithPredisClusterConnection();
100+
106101
Cache::store('redis')->clear();
107102

108103
Cache::store('redis')->tags(['people', 'author'])->put('name', 'Sally', 5);
@@ -119,6 +114,8 @@ public function testTagsCanBeAccessed()
119114

120115
public function testTagEntriesCanBeStoredForever()
121116
{
117+
$this->markTestSkippedWithPredisClusterConnection();
118+
122119
Cache::store('redis')->clear();
123120

124121
Cache::store('redis')->tags(['people', 'author'])->forever('name', 'Sally');
@@ -151,6 +148,8 @@ public function testTagEntriesCanBeIncremented()
151148

152149
public function testIncrementedTagEntriesProperlyTurnStale()
153150
{
151+
$this->markTestSkippedWithPredisClusterConnection();
152+
154153
Cache::store('redis')->clear();
155154

156155
Cache::store('redis')->tags(['votes'])->add('person-1', 0, $seconds = 1);
@@ -167,6 +166,8 @@ public function testIncrementedTagEntriesProperlyTurnStale()
167166

168167
public function testPastTtlTagEntriesAreNotAdded()
169168
{
169+
$this->markTestSkippedWithPredisClusterConnection();
170+
170171
Cache::store('redis')->clear();
171172

172173
Cache::store('redis')->tags(['votes'])->add('person-1', 0, new DateTime('yesterday'));
@@ -180,6 +181,8 @@ public function testPastTtlTagEntriesAreNotAdded()
180181

181182
public function testPutPastTtlTagEntriesProperlyTurnStale()
182183
{
184+
$this->markTestSkippedWithPredisClusterConnection();
185+
183186
Cache::store('redis')->clear();
184187

185188
Cache::store('redis')->tags(['votes'])->put('person-1', 0, new DateTime('yesterday'));
@@ -191,6 +194,8 @@ public function testPutPastTtlTagEntriesProperlyTurnStale()
191194

192195
public function testTagsCanBeFlushedBySingleKey()
193196
{
197+
$this->markTestSkippedWithPredisClusterConnection();
198+
194199
Cache::store('redis')->clear();
195200

196201
Cache::store('redis')->tags(['people', 'author'])->put('person-1', 'Sally', 5);
@@ -207,6 +212,8 @@ public function testTagsCanBeFlushedBySingleKey()
207212

208213
public function testStaleEntriesCanBeFlushed()
209214
{
215+
$this->markTestSkippedWithPredisClusterConnection();
216+
210217
Cache::store('redis')->clear();
211218

212219
Cache::store('redis')->tags(['people', 'author'])->put('person-1', 'Sally', 1);
@@ -225,6 +232,8 @@ public function testStaleEntriesCanBeFlushed()
225232

226233
public function testMultipleItemsCanBeSetAndRetrieved()
227234
{
235+
$this->markTestSkippedWithPredisClusterConnection();
236+
228237
$store = Cache::store('redis');
229238
$result = $store->put('foo', 'bar', 10);
230239
$resultMany = $store->putMany([
@@ -277,6 +286,8 @@ public function testIncrementWithSerializationEnabled()
277286

278287
public function testTagsCanBeFlushedWithLargeNumberOfKeys()
279288
{
289+
$this->markTestSkippedWithPredisClusterConnection();
290+
280291
Cache::store('redis')->clear();
281292

282293
$tags = ['large-test-'.time()];
@@ -298,4 +309,12 @@ public function testTagsCanBeFlushedWithLargeNumberOfKeys()
298309
$keyCount = Cache::store('redis')->connection()->keys('*');
299310
$this->assertCount(0, $keyCount);
300311
}
312+
313+
protected function markTestSkippedWithPredisClusterConnection()
314+
{
315+
$this->markTestSkippedWhen(
316+
$this->app['redis']->connection() instanceof PredisClusterConnection,
317+
'This test currently fails on Predis Cluster connection',
318+
);
319+
}
301320
}

0 commit comments

Comments
 (0)