Skip to content

Commit b54130b

Browse files
committed
[Tests] Refactors initialization of the client for YAML test runner
1 parent d76eb8a commit b54130b

File tree

1 file changed

+3
-5
lines changed
  • elasticsearch-api/spec/yaml-test-runner

1 file changed

+3
-5
lines changed

elasticsearch-api/spec/yaml-test-runner/run.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@
4949
transport_options = {}
5050
end
5151

52-
CLIENT = if ENV['ES_API_KEY']
53-
Elasticsearch::Client.new(host: host, api_key: ENV['ES_API_KEY'], transport_options: transport_options)
54-
else
55-
Elasticsearch::Client.new(host: host, transport_options: transport_options)
56-
end
52+
options = { host: host, transport_options: transport_options, compression: true }
53+
options.merge!({ api_key: ENV['ES_API_KEY'] }) if ENV['ES_API_KEY']
54+
CLIENT = Elasticsearch::Client.new(options)
5755

5856
tests_path = File.expand_path('./tmp', __dir__)
5957
ruby_version = if defined? JRUBY_VERSION

0 commit comments

Comments
 (0)