Skip to content

Commit 477d71e

Browse files
committed
[Test Runner] Updates error catching, skips disallowed scripted metrics tests
1 parent 4abd20f commit 477d71e

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

elasticsearch-api/api-spec-testing/rspec_matchers.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
RSpec::Matchers.define :match_gt_field do |expected_pairs, test|
107107
match do |response|
108108
expected_pairs.all? do |expected_key, expected_value|
109-
110109
split_key = TestFile::Test.split_and_parse_key(expected_key).collect do |k|
111110
test.get_cached_value(k)
112111
end
@@ -128,7 +127,6 @@
128127
RSpec::Matchers.define :match_lte_field do |expected_pairs, test|
129128
match do |response|
130129
expected_pairs.all? do |expected_key, expected_value|
131-
132130
split_key = TestFile::Test.split_and_parse_key(expected_key).collect do |k|
133131
test.get_cached_value(k)
134132
end
@@ -150,7 +148,6 @@
150148
RSpec::Matchers.define :match_lt_field do |expected_pairs, test|
151149
match do |response|
152150
expected_pairs.all? do |expected_key, expected_value|
153-
154151
split_key = TestFile::Test.split_and_parse_key(expected_key).collect do |k|
155152
test.get_cached_value(k)
156153
end
@@ -302,7 +299,8 @@ def compare_string_response(expected_string, response)
302299
# Remove surrounding '/' in string representing Regex
303300
expected_error = expected_error.chomp("/")
304301
expected_error = expected_error[1..-1] if expected_error =~ /^\//
305-
message = actual_error.message.tr("\\","")
302+
303+
message = actual_error.message.tr('\\', '')
306304

307305
case expected_error
308306
when 'request_timeout'
@@ -317,12 +315,12 @@ def compare_string_response(expected_string, response)
317315
message =~ /\[400\]/
318316
when 'param'
319317
message =~ /\[400\]/ ||
320-
actual_error.is_a?(ArgumentError)
318+
actual_error.is_a?(ArgumentError)
321319
when 'unauthorized'
322320
actual_error.is_a?(Elastic::Transport::Transport::Errors::Unauthorized)
323321
when 'forbidden'
324322
actual_error.is_a?(Elastic::Transport::Transport::Errors::Forbidden)
325-
when /error parsing field/
323+
when /error parsing field/, /illegal_argument_exception/
326324
message =~ /\[400\]/ ||
327325
actual_error.is_a?(Elastic::Transport::Transport::Errors::BadRequest)
328326
when /NullPointerException/

elasticsearch-api/spec/rest_api/skipped_tests_free.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,12 @@
107107
-
108108
:file: 'search.vectors/180_update_dense_vector_type.yml'
109109
:description: 'Index, update and merge'
110+
-
111+
:file: 'search/330_disallow_scripted_metrics.yml'
112+
:description: 'all scripts allowed by default'
113+
-
114+
:file: 'search/330_disallow_scripted_metrics.yml'
115+
:description: 'disallow all for empty allow lists'
116+
-
117+
:file: 'search/330_disallow_scripted_metrics.yml'
118+
:description: 'allowed stored scripts do not affect allowed inline scripts'

0 commit comments

Comments
 (0)