Skip to content

Commit 56a0fc8

Browse files
committed
[CI] Fixes instance variable for hosts and transport options in action.rb
Refactors creating client in test runner
1 parent d05c303 commit 56a0fc8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ def execute(client, test = nil)
7373
if headers[:Authorization] == 'Basic eF9wYWNrX3Jlc3RfdXNlcjp4LXBhY2stdGVzdC1wYXNzd29yZA=='
7474
headers.delete(:Authorization)
7575
end
76-
host = client.instance_variable_get('@options')[:host]
77-
transport_options = client.instance_variable_get('@arguments')[:transport_options]
76+
host = client.transport.instance_variable_get('@hosts')
77+
transport_options = client.transport.instance_variable_get('@options')&.dig(:transport_options) || {}
7878
if ENV['QUIET'] == 'true'
7979
# todo: create a method on Elasticsearch::Client that can clone the client with new options
8080
Elasticsearch::Client.new(

elasticsearch-api/spec/elasticsearch/api/rest_api_yaml_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@
4040

4141
ctx = file.gsub("#{YAML_FILES_DIRECTORY}/", '')
4242
context ctx do
43+
let(:client) { DEFAULT_CLIENT }
44+
4345
test_file.tests.each do |test|
4446
context "#{test.description}" do
4547
if test.skip_test?(ADMIN_CLIENT)
4648
skip 'Test contains feature(s) not yet supported or version is not satisfied'
4749
next
4850
end
4951

50-
let(:client) { DEFAULT_CLIENT }
5152
before(:all) { test_file.setup }
5253
after(:all) do
5354
test_file.teardown

0 commit comments

Comments
 (0)