@@ -25,6 +25,7 @@ class Test
2525 GROUP_TERMINATORS = [ 'length' ,
2626 'gt' ,
2727 'set' ,
28+ 'transform_and_set' ,
2829 'match' ,
2930 'is_false' ,
3031 'is_true'
@@ -98,6 +99,7 @@ def task_groups
9899 # @since 6.2.0
99100 def cache_value ( cache_key , value )
100101 @cached_values [ "#{ cache_key } " ] = value
102+ @cached_values
101103 end
102104
103105 # Get a cached value.
@@ -112,7 +114,7 @@ def cache_value(cache_key, value)
112114 # @since 6.2.0
113115 def get_cached_value ( key )
114116 return key unless key . is_a? ( String )
115- @cached_values . fetch ( key . gsub ( /\$ / , '' ) , key )
117+ @cached_values . fetch ( key . gsub ( /[ \$ \{ \} ] / , '' ) , key )
116118 end
117119
118120 # Run all the tasks in this test.
@@ -140,23 +142,26 @@ def run(client)
140142 # @return [ true, false ] Whether this test should be skipped, given a list of unsupported features.
141143 #
142144 # @since 6.2.0
143- def skip_test? ( client , features_to_skip = test_file . skip_features )
145+ def skip_test? ( client , features_to_skip = test_file . features_to_skip )
144146 return false if @skip . empty?
145147 range_partition = /\s *-\s */
146148 @skip . collect { |s | s [ 'skip' ] } . any? do |skip |
147- if features_to_skip . include? ( skip [ 'features' ] )
149+ if ! ( features_to_skip & ( [ skip [ 'features' ] ] . flatten || [ ] ) ) . empty?
148150 true
149151 elsif skip [ 'version' ] == 'all'
150152 true
151- elsif versions = skip [ 'version' ] . partition ( range_partition )
153+ elsif versions = skip [ 'version' ] && skip [ 'version' ] . partition ( range_partition )
152154 low = versions [ 0 ]
153155 high = versions [ 2 ] unless versions [ 2 ] == ''
154156 range = low ..high
155- range . cover? ( client . info [ 'version' ] [ 'number' ] )
157+ begin
158+ client_version = client . info [ 'version' ] [ 'number' ]
159+ rescue
160+ warn ( 'Could not determine Elasticsearch version when checking if test should be skipped.' )
161+ end
162+ range . cover? ( client_version )
156163 end
157164 end
158- rescue
159- warn ( 'Could not determine Elasticsearch version' )
160165 end
161166
162167 private
0 commit comments