Skip to content

Commit d4d4fa0

Browse files
committed
[API] Test Runner: Adds internal prevalidate node removal
1 parent eebcb23 commit d4d4fa0

File tree

1 file changed

+8
-3
lines changed
  • elasticsearch-api/api-spec-testing/test_file

1 file changed

+8
-3
lines changed

elasticsearch-api/api-spec-testing/test_file/action.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ def initialize(definition)
5555
def execute(client, test = nil)
5656
@definition.each.inject(client) do |client, (method_chain, args)|
5757
if method_chain.match?('_internal')
58-
es_version = test.cached_values['es_version'] unless test.nil?
59-
perform_internal(method_chain, args, client, es_version)
58+
perform_internal(method_chain, args, client, test)
6059
else
6160
chain = method_chain.split('.')
6261
# If we have a method nested in a namespace, client becomes the
@@ -143,7 +142,8 @@ def yaml_response?
143142
private
144143

145144
# Executes operations not implemented by elasticsearch-api, such as _internal
146-
def perform_internal(method, args, client, es_version)
145+
def perform_internal(method, args, client, test)
146+
es_version = test.cached_values['es_version'] unless test.nil?
147147
case method
148148
when '_internal.update_desired_nodes'
149149
http = 'PUT'
@@ -178,7 +178,12 @@ def perform_internal(method, args, client, es_version)
178178
end
179179
http = 'GET'
180180
body = args.delete('body')
181+
when '_internal.prevalidate_node_removal'
182+
path = '/_internal/prevalidate_node_removal'
183+
http = 'POST'
184+
body = args.delete('body')
181185
end
186+
args = prepare_arguments(args, test)
182187
@response = Elasticsearch::API::Response.new(client.perform_request(http, path, args, body))
183188
client
184189
end

0 commit comments

Comments
 (0)