39
39
get_supported_protocol_versions , greaterthancass20 ,
40
40
greaterthancass21 , assert_startswith , greaterthanorequalcass40 ,
41
41
greaterthanorequaldse67 , lessthancass40 ,
42
- TestCluster , DSE_VERSION )
42
+ TestCluster , DSE_VERSION , requires_java_udf , requires_composite_type ,
43
+ requires_collection_indexes , xfail_scylla )
43
44
44
45
from tests .util import wait_until
45
46
@@ -474,7 +475,7 @@ def test_counter_with_dense_compact_storage(self):
474
475
tablemeta = self .get_table_metadata ()
475
476
self .check_create_statement (tablemeta , create_statement )
476
477
477
- @unittest . expectedFailure
478
+ @xfail_scylla ( 'https://github.com/scylladb/scylladb/issues/6058' )
478
479
def test_indexes (self ):
479
480
create_statement = self .make_create_statement (["a" ], ["b" , "c" ], ["d" , "e" , "f" ])
480
481
create_statement += " WITH CLUSTERING ORDER BY (b ASC, c ASC)"
@@ -500,7 +501,7 @@ def test_indexes(self):
500
501
self .assertIn ('CREATE INDEX e_index' , statement )
501
502
502
503
@greaterthancass21
503
- @unittest . expectedFailure
504
+ @requires_collection_indexes
504
505
def test_collection_indexes (self ):
505
506
506
507
self .session .execute ("CREATE TABLE %s.%s (a int PRIMARY KEY, b map<text, text>)"
@@ -530,7 +531,8 @@ def test_collection_indexes(self):
530
531
tablemeta = self .get_table_metadata ()
531
532
self .assertIn ('(full(b))' , tablemeta .export_as_string ())
532
533
533
- @unittest .expectedFailure
534
+ #TODO: Fix Scylla or test
535
+ @xfail_scylla ('Scylla prints `compression = {}` instead of `compression = {\' enabled\' : \' false\' }`.' )
534
536
def test_compression_disabled (self ):
535
537
create_statement = self .make_create_statement (["a" ], ["b" ], ["c" ])
536
538
create_statement += " WITH compression = {}"
@@ -565,7 +567,7 @@ def test_non_size_tiered_compaction(self):
565
567
self .assertNotIn ("min_threshold" , cql )
566
568
self .assertNotIn ("max_threshold" , cql )
567
569
568
- @unittest . expectedFailure
570
+ @requires_java_udf
569
571
def test_refresh_schema_metadata (self ):
570
572
"""
571
573
test for synchronously refreshing all cluster metadata
@@ -838,7 +840,7 @@ def test_refresh_user_type_metadata_proto_2(self):
838
840
self .assertEqual (cluster .metadata .keyspaces [self .keyspace_name ].user_types , {})
839
841
cluster .shutdown ()
840
842
841
- @unittest . expectedFailure
843
+ @requires_java_udf
842
844
def test_refresh_user_function_metadata (self ):
843
845
"""
844
846
test for synchronously refreshing UDF metadata in keyspace
@@ -875,7 +877,7 @@ def test_refresh_user_function_metadata(self):
875
877
876
878
cluster2 .shutdown ()
877
879
878
- @unittest . expectedFailure
880
+ @requires_java_udf
879
881
def test_refresh_user_aggregate_metadata (self ):
880
882
"""
881
883
test for synchronously refreshing UDA metadata in keyspace
@@ -919,7 +921,7 @@ def test_refresh_user_aggregate_metadata(self):
919
921
cluster2 .shutdown ()
920
922
921
923
@greaterthanorequalcass30
922
- @unittest . expectedFailure
924
+ @requires_collection_indexes
923
925
def test_multiple_indices (self ):
924
926
"""
925
927
test multiple indices on the same column.
@@ -1544,7 +1546,7 @@ def __init__(self, test_case, **kwargs):
1544
1546
super (FunctionTest .VerifiedAggregate , self ).__init__ (test_case , Aggregate , test_case .keyspace_aggregate_meta , ** kwargs )
1545
1547
1546
1548
1547
- @unittest . expectedFailure
1549
+ @requires_java_udf
1548
1550
class FunctionMetadata (FunctionTest ):
1549
1551
1550
1552
def make_function_kwargs (self , called_on_null = True ):
@@ -1699,6 +1701,7 @@ def test_function_cql_called_on_null(self):
1699
1701
self .assertRegex (fn_meta .as_cql_query (), "CREATE FUNCTION.*\) RETURNS NULL ON NULL INPUT RETURNS .*" )
1700
1702
1701
1703
1704
+ @requires_java_udf
1702
1705
class AggregateMetadata (FunctionTest ):
1703
1706
1704
1707
@classmethod
@@ -1743,7 +1746,6 @@ def make_aggregate_kwargs(self, state_func, state_type, final_func=None, init_co
1743
1746
'return_type' : "does not matter for creation" ,
1744
1747
'deterministic' : False }
1745
1748
1746
- @unittest .expectedFailure
1747
1749
def test_return_type_meta (self ):
1748
1750
"""
1749
1751
Test to verify to that the return type of a an aggregate is honored in the metadata
@@ -1761,7 +1763,6 @@ def test_return_type_meta(self):
1761
1763
with self .VerifiedAggregate (self , ** self .make_aggregate_kwargs ('sum_int' , 'int' , init_cond = '1' )) as va :
1762
1764
self .assertEqual (self .keyspace_aggregate_meta [va .signature ].return_type , 'int' )
1763
1765
1764
- @unittest .expectedFailure
1765
1766
def test_init_cond (self ):
1766
1767
"""
1767
1768
Test to verify that various initial conditions are correctly surfaced in various aggregate functions
@@ -1812,7 +1813,6 @@ def test_init_cond(self):
1812
1813
self .assertDictContainsSubset (init_not_updated , map_res )
1813
1814
c .shutdown ()
1814
1815
1815
- @unittest .expectedFailure
1816
1816
def test_aggregates_after_functions (self ):
1817
1817
"""
1818
1818
Test to verify that aggregates are listed after function in metadata
@@ -1835,7 +1835,6 @@ def test_aggregates_after_functions(self):
1835
1835
self .assertNotIn (- 1 , (aggregate_idx , func_idx ), "AGGREGATE or FUNCTION not found in keyspace_cql: " + keyspace_cql )
1836
1836
self .assertGreater (aggregate_idx , func_idx )
1837
1837
1838
- @unittest .expectedFailure
1839
1838
def test_same_name_diff_types (self ):
1840
1839
"""
1841
1840
Test to verify to that aggregates with different signatures are differentiated in metadata
@@ -1858,7 +1857,6 @@ def test_same_name_diff_types(self):
1858
1857
self .assertEqual (len (aggregates ), 2 )
1859
1858
self .assertNotEqual (aggregates [0 ].argument_types , aggregates [1 ].argument_types )
1860
1859
1861
- @unittest .expectedFailure
1862
1860
def test_aggregates_follow_keyspace_alter (self ):
1863
1861
"""
1864
1862
Test to verify to that aggregates maintain equality after a keyspace is altered
@@ -1883,7 +1881,6 @@ def test_aggregates_follow_keyspace_alter(self):
1883
1881
finally :
1884
1882
self .session .execute ('ALTER KEYSPACE %s WITH durable_writes = true' % self .keyspace_name )
1885
1883
1886
- @unittest .expectedFailure
1887
1884
def test_cql_optional_params (self ):
1888
1885
"""
1889
1886
Test to verify that the initial_cond and final_func parameters are correctly honored
@@ -2018,7 +2015,7 @@ def test_bad_user_type(self):
2018
2015
self .assertIn ("/*\n Warning:" , m .export_as_string ())
2019
2016
2020
2017
@greaterthancass21
2021
- @unittest . expectedFailure
2018
+ @requires_java_udf
2022
2019
def test_bad_user_function (self ):
2023
2020
self .session .execute ("""CREATE FUNCTION IF NOT EXISTS %s (key int, val int)
2024
2021
RETURNS NULL ON NULL INPUT
@@ -2037,7 +2034,7 @@ def test_bad_user_function(self):
2037
2034
self .assertIn ("/*\n Warning:" , m .export_as_string ())
2038
2035
2039
2036
@greaterthancass21
2040
- @unittest . expectedFailure
2037
+ @requires_java_udf
2041
2038
def test_bad_user_aggregate (self ):
2042
2039
self .session .execute ("""CREATE FUNCTION IF NOT EXISTS sum_int (key int, val int)
2043
2040
RETURNS NULL ON NULL INPUT
@@ -2058,7 +2055,7 @@ def test_bad_user_aggregate(self):
2058
2055
2059
2056
class DynamicCompositeTypeTest (BasicSharedKeyspaceUnitTestCase ):
2060
2057
2061
- @unittest . expectedFailure
2058
+ @requires_composite_type
2062
2059
def test_dct_alias (self ):
2063
2060
"""
2064
2061
Tests to make sure DCT's have correct string formatting
0 commit comments