File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
elasticsearch-api/spec/rest_api Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 20
20
require_relative './run_rspec_matchers'
21
21
22
22
LOGGER = Logger . new ( $stdout)
23
+ CLUSTER_FEATURES = ADMIN_CLIENT . features . get_features [ 'features' ] . map { |f | f [ 'name' ] }
24
+
25
+ def skip_test? ( test )
26
+ # To support new features skipping in YAML tests. This will go away with new YAML tests:
27
+ if ( feature_to_skip = test . skip &.first &.[]( 'skip' ) &.[]( 'cluster_features' ) )
28
+ return true unless CLUSTER_FEATURES . include? ( feature_to_skip )
29
+ end
30
+ # Support skipping 'awaits_fix'
31
+ !!test . test_file . instance_variable_get ( '@skip' ) &.first &.[]( 'skip' ) &.[]( 'awaits_fix' ) ||
32
+ !!test . skip &.first &.[]( 'skip' ) &.[]( 'awaits_fix' )
33
+ end
23
34
24
35
describe 'Rest API YAML tests' do
25
36
LOGGER . info "Elastic Transport version: #{ Elastic ::Transport ::VERSION } "
30
41
exit 1
31
42
end
32
43
33
- CLUSTER_FEATURES = ADMIN_CLIENT . features . get_features [ 'features' ] . map { |f | f [ 'name' ] }
34
-
35
44
# Traverse YAML files and create TestFile object:
36
45
REST_API_YAML_FILES . each do |file |
37
46
begin
48
57
let ( :client ) { DEFAULT_CLIENT }
49
58
50
59
test_file . tests . each do |test |
51
- # To support new features skipping in YAML tests. This will go away with new YAML tests:
52
- if ( feature_to_skip = test . skip &.first &.[]( 'skip' ) &.[]( 'cluster_features' ) )
53
- next unless CLUSTER_FEATURES . include? feature_to_skip
54
- end
60
+ next if skip_test? ( test )
61
+
55
62
context test . description do
56
63
if test . skip_test? ( ADMIN_CLIENT )
57
64
skip 'Test contains feature(s) not yet supported or version is not satisfied'
You can’t perform that action at this time.
0 commit comments