elasticsearch-transport 5.0.5 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -17
- data/elasticsearch-transport.gemspec +0 -1
- data/lib/elasticsearch/transport/client.rb +0 -3
- data/lib/elasticsearch/transport/transport/base.rb +1 -1
- data/lib/elasticsearch/transport/version.rb +1 -1
- data/test/integration/client_test.rb +3 -3
- data/test/profile/client_benchmark_test.rb +19 -25
- data/test/unit/client_test.rb +0 -8
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be60395711be8973daf97621fdcb1b88f3724ad4
|
4
|
+
data.tar.gz: 534bf35af741369ce1fc4e13d049b3937f4dc8a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c935fbe7e202f16c699d00c0755928a04e9c439a378cd5891673d20d8ff894d56b3a167e2ffa0071f7c997ccdb6916b960e028c1246c8f28f9f8ef09a503c3fc
|
7
|
+
data.tar.gz: 2c918059b5b6237b81827b68b703543119ec2d6d1788e4a2c82d205aaf1832b5a0ff1ae7a82b1ad9698d78432427e1ea1fc48dec28b9307ae081c1f685e2ec65
|
data/Rakefile
CHANGED
@@ -8,39 +8,26 @@ task :test => 'test:unit'
|
|
8
8
|
|
9
9
|
require 'rake/testtask'
|
10
10
|
namespace :test do
|
11
|
-
task :ci_reporter do
|
12
|
-
ENV['CI_REPORTS'] ||= 'tmp/reports'
|
13
|
-
if defined?(RUBY_VERSION) && RUBY_VERSION < '1.9'
|
14
|
-
require 'ci/reporter/rake/test_unit'
|
15
|
-
Rake::Task['ci:setup:testunit'].invoke
|
16
|
-
else
|
17
|
-
require 'ci/reporter/rake/minitest'
|
18
|
-
Rake::Task['ci:setup:minitest'].invoke
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
11
|
Rake::TestTask.new(:unit) do |test|
|
23
|
-
Rake::Task['test:ci_reporter'].invoke if ENV['CI']
|
24
12
|
test.libs << 'lib' << 'test'
|
25
13
|
test.test_files = FileList["test/unit/**/*_test.rb"]
|
26
|
-
|
27
|
-
|
14
|
+
test.verbose = false
|
15
|
+
test.warning = false
|
28
16
|
end
|
29
17
|
|
30
18
|
Rake::TestTask.new(:integration) do |test|
|
31
|
-
Rake::Task['test:ci_reporter'].invoke if ENV['CI']
|
32
19
|
test.libs << 'lib' << 'test'
|
33
20
|
test.test_files = FileList["test/integration/**/*_test.rb"]
|
21
|
+
test.verbose = false
|
22
|
+
test.warning = false
|
34
23
|
end
|
35
24
|
|
36
25
|
Rake::TestTask.new(:all) do |test|
|
37
|
-
Rake::Task['test:ci_reporter'].invoke if ENV['CI']
|
38
26
|
test.libs << 'lib' << 'test'
|
39
27
|
test.test_files = FileList["test/unit/**/*_test.rb", "test/integration/**/*_test.rb"]
|
40
28
|
end
|
41
29
|
|
42
30
|
Rake::TestTask.new(:profile) do |test|
|
43
|
-
Rake::Task['test:ci_reporter'].invoke if ENV['CI']
|
44
31
|
test.libs << 'lib' << 'test'
|
45
32
|
test.test_files = FileList["test/profile/**/*_test.rb"]
|
46
33
|
end
|
@@ -45,7 +45,6 @@ Gem::Specification.new do |s|
|
|
45
45
|
s.add_development_dependency "turn"
|
46
46
|
s.add_development_dependency "yard"
|
47
47
|
s.add_development_dependency "pry"
|
48
|
-
s.add_development_dependency "ci_reporter", "~> 1.9"
|
49
48
|
|
50
49
|
# Gems for testing integrations
|
51
50
|
s.add_development_dependency "curb" unless defined? JRUBY_VERSION
|
@@ -129,7 +129,7 @@ module Elasticsearch
|
|
129
129
|
Connections::Collection.new \
|
130
130
|
:connections => hosts.map { |host|
|
131
131
|
host[:protocol] = host[:scheme] || options[:scheme] || options[:http][:scheme] || DEFAULT_PROTOCOL
|
132
|
-
host[:port] ||= options[:port] || options[:http][:
|
132
|
+
host[:port] ||= options[:port] || options[:http][:port] || DEFAULT_PORT
|
133
133
|
if (options[:user] || options[:http][:user]) && !host[:user]
|
134
134
|
host[:user] ||= options[:user] || options[:http][:user]
|
135
135
|
host[:password] ||= options[:password] || options[:http][:password]
|
@@ -54,11 +54,11 @@ class Elasticsearch::Transport::ClientIntegrationTest < Elasticsearch::Test::Int
|
|
54
54
|
end
|
55
55
|
|
56
56
|
should "ignore specified response codes" do
|
57
|
-
response = @client.perform_request '
|
57
|
+
response = @client.perform_request 'PUT', '_foobar', ignore: 400
|
58
58
|
assert_equal 400, response.status
|
59
59
|
|
60
60
|
assert_instance_of Hash, response.body
|
61
|
-
assert_match /
|
61
|
+
assert_match /invalid_index_name_exception/, response.body.inspect
|
62
62
|
end
|
63
63
|
|
64
64
|
should "pass options to the transport" do
|
@@ -177,7 +177,7 @@ class Elasticsearch::Transport::ClientIntegrationTest < Elasticsearch::Test::Int
|
|
177
177
|
.times(4)
|
178
178
|
|
179
179
|
assert_raise Elasticsearch::Transport::Transport::Errors::BadRequest do
|
180
|
-
@client.perform_request '
|
180
|
+
@client.perform_request 'PUT', '_foobar'
|
181
181
|
end
|
182
182
|
end
|
183
183
|
end
|
@@ -9,15 +9,15 @@ class Elasticsearch::Transport::ClientProfilingTest < Elasticsearch::Test::Profi
|
|
9
9
|
setup do
|
10
10
|
@port = (ENV['TEST_CLUSTER_PORT'] || 9250).to_i
|
11
11
|
client = Elasticsearch::Client.new host: "localhost:#{@port}", adapter: ::Faraday.default_adapter
|
12
|
-
client.perform_request 'DELETE', '
|
13
|
-
client.perform_request '
|
14
|
-
100.times do client.perform_request 'POST', '
|
15
|
-
client.perform_request 'POST', '
|
12
|
+
client.perform_request 'DELETE', 'ruby_test_benchmark' rescue nil
|
13
|
+
client.perform_request 'PUT', 'ruby_test_benchmark', {}, {settings: {index: {number_of_shards: 1, number_of_replicas: 0}}}
|
14
|
+
100.times do client.perform_request 'POST', 'ruby_test_benchmark_search/test', {}, {foo: 'bar'}; end
|
15
|
+
client.perform_request 'POST', 'ruby_test_benchmark_search/_refresh'
|
16
16
|
end
|
17
17
|
teardown do
|
18
18
|
client = Elasticsearch::Client.new host: "localhost:#{@port}"
|
19
|
-
client.perform_request 'DELETE', '
|
20
|
-
client.perform_request 'DELETE', '
|
19
|
+
client.perform_request 'DELETE', 'ruby_test_benchmark' rescue nil
|
20
|
+
client.perform_request 'DELETE', 'ruby_test_benchmark_search' rescue nil
|
21
21
|
end
|
22
22
|
|
23
23
|
context "with a single-node cluster and the default adapter" do
|
@@ -30,11 +30,11 @@ class Elasticsearch::Transport::ClientProfilingTest < Elasticsearch::Test::Profi
|
|
30
30
|
end
|
31
31
|
|
32
32
|
measure "index a document" do
|
33
|
-
@client.perform_request 'POST', '
|
33
|
+
@client.perform_request 'POST', 'ruby_test_benchmark/test', {}, {foo: 'bar'}
|
34
34
|
end
|
35
35
|
|
36
36
|
measure "search" do
|
37
|
-
@client.perform_request '
|
37
|
+
@client.perform_request 'GET', 'ruby_test_benchmark_search/test/_search', {}, {query: {match: {foo: 'bar'}}}
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -48,11 +48,11 @@ class Elasticsearch::Transport::ClientProfilingTest < Elasticsearch::Test::Profi
|
|
48
48
|
end
|
49
49
|
|
50
50
|
measure "index a document"do
|
51
|
-
@client.perform_request 'POST', '
|
51
|
+
@client.perform_request 'POST', 'ruby_test_benchmark/test', {}, {foo: 'bar'}
|
52
52
|
end
|
53
53
|
|
54
54
|
measure "search" do
|
55
|
-
@client.perform_request '
|
55
|
+
@client.perform_request 'GET', 'ruby_test_benchmark_search/test/_search', {}, {query: {match: {foo: 'bar'}}}
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -69,25 +69,19 @@ class Elasticsearch::Transport::ClientProfilingTest < Elasticsearch::Test::Profi
|
|
69
69
|
end
|
70
70
|
|
71
71
|
measure "index a document" do
|
72
|
-
@client.perform_request 'POST', '
|
72
|
+
@client.perform_request 'POST', 'ruby_test_benchmark/test', {}, {foo: 'bar'}
|
73
73
|
end
|
74
74
|
|
75
75
|
measure "search" do
|
76
|
-
@client.perform_request '
|
76
|
+
@client.perform_request 'GET', 'ruby_test_benchmark_search/test/_search', {}, {query: {match: {foo: 'bar'}}}
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
80
|
context "with a single-node cluster and the Typhoeus client" do
|
81
|
-
require 'typhoeus'
|
82
|
-
require 'typhoeus/adapters/faraday'
|
83
|
-
|
84
81
|
setup do
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
end
|
89
|
-
|
90
|
-
@client = Elasticsearch::Client.new transport: transport
|
82
|
+
require 'typhoeus'
|
83
|
+
require 'typhoeus/adapters/faraday'
|
84
|
+
@client = Elasticsearch::Client.new host: "localhost:#{@port}", adapter: :typhoeus
|
91
85
|
end
|
92
86
|
|
93
87
|
measure "get the cluster info", count: 1_000 do
|
@@ -95,11 +89,11 @@ class Elasticsearch::Transport::ClientProfilingTest < Elasticsearch::Test::Profi
|
|
95
89
|
end
|
96
90
|
|
97
91
|
measure "index a document" do
|
98
|
-
@client.perform_request 'POST', '
|
92
|
+
@client.perform_request 'POST', 'ruby_test_benchmark/test', {}, {foo: 'bar'}
|
99
93
|
end
|
100
94
|
|
101
95
|
measure "search" do
|
102
|
-
@client.perform_request '
|
96
|
+
@client.perform_request 'GET', 'ruby_test_benchmark_search/test/_search', {}, {query: {match: {foo: 'bar'}}}
|
103
97
|
end
|
104
98
|
end
|
105
99
|
|
@@ -114,11 +108,11 @@ class Elasticsearch::Transport::ClientProfilingTest < Elasticsearch::Test::Profi
|
|
114
108
|
end
|
115
109
|
|
116
110
|
measure "index a document" do
|
117
|
-
@client.perform_request 'POST', '
|
111
|
+
@client.perform_request 'POST', 'ruby_test_benchmark/test', {}, {foo: 'bar'}
|
118
112
|
end
|
119
113
|
|
120
114
|
measure "search" do
|
121
|
-
@client.perform_request '
|
115
|
+
@client.perform_request 'GET', 'ruby_test_benchmark_search/test/_search', {}, {query: {match: {foo: 'bar'}}}
|
122
116
|
end
|
123
117
|
end
|
124
118
|
end
|
data/test/unit/client_test.rb
CHANGED
@@ -228,14 +228,6 @@ class Elasticsearch::Transport::ClientTest < Test::Unit::TestCase
|
|
228
228
|
assert_equal 'bar', hosts[1][:host]
|
229
229
|
end
|
230
230
|
|
231
|
-
should "remove trailing slash from URL path" do
|
232
|
-
hosts = @client.__extract_hosts 'http://myhost/'
|
233
|
-
assert_equal '', hosts[0][:path]
|
234
|
-
|
235
|
-
hosts = @client.__extract_hosts 'http://myhost/foo/bar/'
|
236
|
-
assert_equal '/foo/bar', hosts[0][:path]
|
237
|
-
end
|
238
|
-
|
239
231
|
should "raise error for incompatible argument" do
|
240
232
|
assert_raise ArgumentError do
|
241
233
|
@client.__extract_hosts 123
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-transport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karel Minarik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -164,20 +164,6 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: ci_reporter
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - "~>"
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '1.9'
|
174
|
-
type: :development
|
175
|
-
prerelease: false
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
177
|
-
requirements:
|
178
|
-
- - "~>"
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: '1.9'
|
181
167
|
- !ruby/object:Gem::Dependency
|
182
168
|
name: curb
|
183
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -415,7 +401,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
415
401
|
version: '0'
|
416
402
|
requirements: []
|
417
403
|
rubyforge_project:
|
418
|
-
rubygems_version: 2.
|
404
|
+
rubygems_version: 2.5.2
|
419
405
|
signing_key:
|
420
406
|
specification_version: 4
|
421
407
|
summary: Ruby client for Elasticsearch.
|