@@ -19,6 +19,15 @@ public class SearchTests(EndpointsFixture endpointsFixture, ITestOutputHelper lo
19
19
// private readonly string key = "SEARCH_TESTS";
20
20
private readonly string index = "TEST_INDEX" ;
21
21
22
+ private static void SkipClusterPre8 ( string endpointId )
23
+ {
24
+ // Many of the FT.* commands are ... more awkward pre 8 when using cluster. Rather than
25
+ // fight eventual-consistency/timing issues: grandfather the existing behaviour, and start
26
+ // afresh from v8, where things behave much more predictably and reasonably.
27
+ Skip . If ( endpointId == EndpointsFixture . Env . Cluster
28
+ && EndpointsFixture . RedisVersion . Major < 8 , "Ignoring cluster tests for FT.SEARCH pre Redis 8.0" ) ;
29
+ }
30
+
22
31
private void AddDocument ( IDatabase db , Document doc )
23
32
{
24
33
var hash = doc . GetProperties ( )
@@ -235,6 +244,7 @@ public async Task TestAggregationsAsync(string endpointId)
235
244
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
236
245
public void TestAggregationsLoad ( string endpointId )
237
246
{
247
+ SkipClusterPre8 ( endpointId ) ;
238
248
IDatabase db = GetCleanDatabase ( endpointId ) ;
239
249
var ft = db . FT ( ) ;
240
250
var sc = new Schema ( ) . AddTextField ( "t1" ) . AddTextField ( "t2" ) ;
@@ -632,6 +642,7 @@ public async Task TestCreateAsync(string endpointId)
632
642
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
633
643
public void CreateNoParams ( string endpointId )
634
644
{
645
+ SkipClusterPre8 ( endpointId ) ;
635
646
IDatabase db = GetCleanDatabase ( endpointId ) ;
636
647
var ft = db . FT ( ) ;
637
648
@@ -690,6 +701,7 @@ public async Task CreateNoParamsAsync(string endpointId)
690
701
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
691
702
public void CreateWithFieldNames ( string endpointId )
692
703
{
704
+ SkipClusterPre8 ( endpointId ) ;
693
705
IDatabase db = GetCleanDatabase ( endpointId ) ;
694
706
var ft = db . FT ( ) ;
695
707
Schema sc = new Schema ( ) . AddField ( new TextField ( FieldName . Of ( "first" ) . As ( "given" ) ) )
@@ -869,6 +881,7 @@ public void AlterAdd(string endpointId)
869
881
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
870
882
public async Task AlterAddAsync ( string endpointId )
871
883
{
884
+ SkipClusterPre8 ( endpointId ) ;
872
885
IDatabase db = GetCleanDatabase ( endpointId ) ;
873
886
var ft = db . FT ( ) ;
874
887
Schema sc = new Schema ( ) . AddTextField ( "title" , 1.0 ) ;
@@ -956,6 +969,7 @@ public async Task AlterAddAsync(string endpointId)
956
969
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
957
970
public void AlterAddSortable ( string endpointId )
958
971
{
972
+ SkipClusterPre8 ( endpointId ) ;
959
973
IDatabase db = GetCleanDatabase ( endpointId ) ;
960
974
var ft = db . FT ( ) ;
961
975
Schema sc = new Schema ( ) . AddTextField ( "title" , 1.0 , sortable : true ) ;
@@ -1251,6 +1265,7 @@ public async Task TestDialectConfigAsync(string endpointId)
1251
1265
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
1252
1266
public async Task TestCursor ( string endpointId )
1253
1267
{
1268
+ SkipClusterPre8 ( endpointId ) ;
1254
1269
IDatabase db = GetCleanDatabase ( endpointId ) ;
1255
1270
var ft = db . FT ( ) ;
1256
1271
Schema sc = new ( ) ;
@@ -1306,6 +1321,7 @@ public async Task TestCursor(string endpointId)
1306
1321
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
1307
1322
public void TestCursorEnumerable ( string endpointId )
1308
1323
{
1324
+ SkipClusterPre8 ( endpointId ) ;
1309
1325
IDatabase db = GetCleanDatabase ( endpointId ) ;
1310
1326
var ft = db . FT ( ) ;
1311
1327
Schema sc = new ( ) ;
@@ -1344,6 +1360,7 @@ public void TestCursorEnumerable(string endpointId)
1344
1360
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
1345
1361
public async Task TestCursorAsync ( string endpointId )
1346
1362
{
1363
+ SkipClusterPre8 ( endpointId ) ;
1347
1364
IDatabase db = GetCleanDatabase ( endpointId ) ;
1348
1365
var ft = db . FT ( ) ;
1349
1366
Schema sc = new ( ) ;
@@ -1399,6 +1416,7 @@ public async Task TestCursorAsync(string endpointId)
1399
1416
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
1400
1417
public async Task TestCursorEnumerableAsync ( string endpointId )
1401
1418
{
1419
+ SkipClusterPre8 ( endpointId ) ;
1402
1420
IDatabase db = GetCleanDatabase ( endpointId ) ;
1403
1421
var ft = db . FT ( ) ;
1404
1422
Schema sc = new ( ) ;
@@ -1587,6 +1605,7 @@ public void TestDictionary(string endpointId)
1587
1605
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
1588
1606
public void TestDropIndex ( string endpointId )
1589
1607
{
1608
+ SkipClusterPre8 ( endpointId ) ;
1590
1609
IDatabase db = GetCleanDatabase ( endpointId ) ;
1591
1610
var ft = db . FT ( ) ;
1592
1611
Schema sc = new Schema ( ) . AddTextField ( "title" , 1.0 ) ;
@@ -1656,6 +1675,7 @@ private async Task<int> DatabaseSizeAsync(IDatabase db)
1656
1675
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
1657
1676
public async Task TestDropIndexAsync ( string endpointId )
1658
1677
{
1678
+ SkipClusterPre8 ( endpointId ) ;
1659
1679
IDatabase db = GetCleanDatabase ( endpointId ) ;
1660
1680
var ft = db . FT ( ) ;
1661
1681
Schema sc = new Schema ( ) . AddTextField ( "title" , 1.0 ) ;
@@ -1690,6 +1710,7 @@ public async Task TestDropIndexAsync(string endpointId)
1690
1710
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
1691
1711
public void dropIndexDD ( string endpointId )
1692
1712
{
1713
+ SkipClusterPre8 ( endpointId ) ;
1693
1714
IDatabase db = GetCleanDatabase ( endpointId ) ;
1694
1715
var ft = db . FT ( ) ;
1695
1716
Schema sc = new Schema ( ) . AddTextField ( "title" , 1.0 ) ;
@@ -1716,6 +1737,7 @@ public void dropIndexDD(string endpointId)
1716
1737
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
1717
1738
public async Task dropIndexDDAsync ( string endpointId )
1718
1739
{
1740
+ SkipClusterPre8 ( endpointId ) ;
1719
1741
IDatabase db = GetCleanDatabase ( endpointId ) ;
1720
1742
var ft = db . FT ( ) ;
1721
1743
Schema sc = new Schema ( ) . AddTextField ( "title" , 1.0 ) ;
@@ -2145,6 +2167,7 @@ public void TestFTCreateParamsCommandBuilderNoStopwords()
2145
2167
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
2146
2168
public void TestFilters ( string endpointId )
2147
2169
{
2170
+ SkipClusterPre8 ( endpointId ) ;
2148
2171
IDatabase db = GetCleanDatabase ( endpointId ) ;
2149
2172
var ft = db . FT ( ) ;
2150
2173
// Create the index with the same fields as in the original test
@@ -2465,6 +2488,7 @@ public void TestFieldsCommandBuilder()
2465
2488
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
2466
2489
public void TestLimit ( string endpointId )
2467
2490
{
2491
+ SkipClusterPre8 ( endpointId ) ;
2468
2492
IDatabase db = GetCleanDatabase ( endpointId ) ;
2469
2493
var ft = db . FT ( ) ;
2470
2494
@@ -2486,6 +2510,7 @@ public void TestLimit(string endpointId)
2486
2510
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
2487
2511
public async Task TestLimitAsync ( string endpointId )
2488
2512
{
2513
+ SkipClusterPre8 ( endpointId ) ;
2489
2514
IDatabase db = GetCleanDatabase ( endpointId ) ;
2490
2515
var ft = db . FT ( ) ;
2491
2516
@@ -2602,6 +2627,7 @@ public void VectorSimilaritySearch(string endpointId)
2602
2627
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
2603
2628
public void QueryingVectorFields ( string endpointId )
2604
2629
{
2630
+ SkipClusterPre8 ( endpointId ) ;
2605
2631
IDatabase db = GetCleanDatabase ( endpointId ) ;
2606
2632
var ft = db . FT ( ) ;
2607
2633
var json = db . JSON ( ) ;
@@ -2690,6 +2716,7 @@ public async Task TestQueryAddParam_DefaultDialectAsync(string endpointId)
2690
2716
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
2691
2717
public void TestQueryParamsWithParams_DefaultDialect ( string endpointId )
2692
2718
{
2719
+ SkipClusterPre8 ( endpointId ) ;
2693
2720
IDatabase db = GetCleanDatabase ( endpointId ) ;
2694
2721
var ft = db . FT ( 2 ) ;
2695
2722
@@ -2761,6 +2788,7 @@ public async Task TestBasicSpellCheckAsync(string endpointId)
2761
2788
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
2762
2789
public void TestCrossTermDictionary ( string endpointId )
2763
2790
{
2791
+ SkipClusterPre8 ( endpointId ) ;
2764
2792
IDatabase db = GetCleanDatabase ( endpointId ) ;
2765
2793
var ft = db . FT ( ) ;
2766
2794
@@ -2787,6 +2815,7 @@ public void TestCrossTermDictionary(string endpointId)
2787
2815
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
2788
2816
public async Task TestCrossTermDictionaryAsync ( string endpointId )
2789
2817
{
2818
+ SkipClusterPre8 ( endpointId ) ;
2790
2819
IDatabase db = GetCleanDatabase ( endpointId ) ;
2791
2820
var ft = db . FT ( ) ;
2792
2821
@@ -2858,6 +2887,7 @@ await Assert.ThrowsAsync<RedisServerException>(async () =>
2858
2887
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
2859
2888
public async Task TestQueryParamsWithParams_DefaultDialectAsync ( string endpointId )
2860
2889
{
2890
+ SkipClusterPre8 ( endpointId ) ;
2861
2891
IDatabase db = GetCleanDatabase ( endpointId ) ;
2862
2892
var ft = db . FT ( 2 ) ;
2863
2893
@@ -3344,6 +3374,7 @@ public void TestProfileIssue306(string endpointId)
3344
3374
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
3345
3375
public async Task TestProfileAsyncIssue306 ( string endpointId )
3346
3376
{
3377
+ SkipClusterPre8 ( endpointId ) ;
3347
3378
IDatabase db = GetCleanDatabase ( endpointId ) ;
3348
3379
var ft = db . FT ( ) ;
3349
3380
@@ -3404,6 +3435,7 @@ public void Issue175(string endpointId)
3404
3435
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
3405
3436
public void GeoShapeFilterSpherical ( string endpointId )
3406
3437
{
3438
+ SkipClusterPre8 ( endpointId ) ;
3407
3439
IDatabase db = GetCleanDatabase ( endpointId ) ;
3408
3440
var ft = db . FT ( ) ;
3409
3441
@@ -3469,6 +3501,7 @@ public void GeoShapeFilterSpherical(string endpointId)
3469
3501
[ MemberData ( nameof ( EndpointsFixture . Env . AllEnvironments ) , MemberType = typeof ( EndpointsFixture . Env ) ) ]
3470
3502
public async Task GeoShapeFilterSphericalAsync ( string endpointId )
3471
3503
{
3504
+ SkipClusterPre8 ( endpointId ) ;
3472
3505
IDatabase db = GetCleanDatabase ( endpointId ) ;
3473
3506
var ft = db . FT ( ) ;
3474
3507
0 commit comments