elasticsearch-transport 6.8.3 → 7.0.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +17 -0
- data/LICENSE.txt +199 -10
- data/README.md +32 -86
- data/Rakefile +23 -4
- data/elasticsearch-transport.gemspec +78 -45
- data/lib/elasticsearch-transport.rb +16 -3
- data/lib/elasticsearch/transport.rb +17 -3
- data/lib/elasticsearch/transport/client.rb +70 -174
- data/lib/elasticsearch/transport/redacted.rb +5 -9
- data/lib/elasticsearch/transport/transport/base.rb +63 -55
- data/lib/elasticsearch/transport/transport/connections/collection.rb +16 -3
- data/lib/elasticsearch/transport/transport/connections/connection.rb +16 -3
- data/lib/elasticsearch/transport/transport/connections/selector.rb +16 -3
- data/lib/elasticsearch/transport/transport/errors.rb +16 -3
- data/lib/elasticsearch/transport/transport/http/curb.rb +18 -5
- data/lib/elasticsearch/transport/transport/http/faraday.rb +18 -5
- data/lib/elasticsearch/transport/transport/http/manticore.rb +17 -4
- data/lib/elasticsearch/transport/transport/loggable.rb +85 -0
- data/lib/elasticsearch/transport/transport/response.rb +16 -3
- data/lib/elasticsearch/transport/transport/serializer/multi_json.rb +16 -3
- data/lib/elasticsearch/transport/transport/sniffer.rb +17 -5
- data/lib/elasticsearch/transport/version.rb +17 -4
- data/spec/elasticsearch/transport/base_spec.rb +8 -187
- data/spec/elasticsearch/transport/client_spec.rb +29 -163
- data/spec/elasticsearch/transport/sniffer_spec.rb +19 -0
- data/spec/spec_helper.rb +2 -11
- data/test/integration/transport_test.rb +18 -5
- data/test/profile/client_benchmark_test.rb +16 -3
- data/test/test_helper.rb +63 -14
- data/test/unit/connection_collection_test.rb +17 -4
- data/test/unit/connection_selector_test.rb +17 -4
- data/test/unit/connection_test.rb +17 -4
- data/test/unit/response_test.rb +18 -5
- data/test/unit/serializer_test.rb +17 -4
- data/test/unit/transport_base_test.rb +21 -8
- data/test/unit/transport_curb_test.rb +17 -4
- data/test/unit/transport_faraday_test.rb +17 -4
- data/test/unit/transport_manticore_test.rb +24 -6
- metadata +61 -86
- data/spec/elasticsearch/transport/meta_header_spec.rb +0 -214
data/test/test_helper.rb
CHANGED
@@ -1,9 +1,20 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more
|
2
|
-
#
|
3
|
-
#
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
4
17
|
|
5
|
-
RUBY_1_8 = defined?(RUBY_VERSION) && RUBY_VERSION < '1.9'
|
6
|
-
JRUBY = defined?(JRUBY_VERSION)
|
7
18
|
|
8
19
|
ELASTICSEARCH_HOSTS = if hosts = ENV['TEST_ES_SERVER'] || ENV['ELASTICSEARCH_HOSTS']
|
9
20
|
hosts.split(',').map do |host|
|
@@ -11,6 +22,11 @@ ELASTICSEARCH_HOSTS = if hosts = ENV['TEST_ES_SERVER'] || ENV['ELASTICSEARCH_HOS
|
|
11
22
|
end
|
12
23
|
end.freeze
|
13
24
|
|
25
|
+
TEST_HOST, TEST_PORT = ELASTICSEARCH_HOSTS.first.split(':') if ELASTICSEARCH_HOSTS
|
26
|
+
|
27
|
+
RUBY_1_8 = defined?(RUBY_VERSION) && RUBY_VERSION < '1.9'
|
28
|
+
JRUBY = defined?(JRUBY_VERSION)
|
29
|
+
|
14
30
|
if RUBY_1_8 and not ENV['BUNDLE_GEMFILE']
|
15
31
|
require 'rubygems'
|
16
32
|
gem 'test-unit'
|
@@ -36,11 +52,12 @@ if defined?(RUBY_VERSION) && RUBY_VERSION > '1.9'
|
|
36
52
|
at_exit { Elasticsearch::Test::IntegrationTestCase.__run_at_exit_hooks }
|
37
53
|
end
|
38
54
|
|
39
|
-
require 'test/unit'
|
40
|
-
require '
|
41
|
-
require '
|
55
|
+
require 'test/unit' if RUBY_1_8
|
56
|
+
require 'minitest/autorun'
|
57
|
+
require 'minitest/reporters'
|
58
|
+
require 'shoulda/context'
|
59
|
+
require 'mocha/minitest'
|
42
60
|
require 'ansi/code'
|
43
|
-
require 'turn' unless ENV["TM_FILEPATH"] || ENV["NOTURN"] || RUBY_1_8
|
44
61
|
|
45
62
|
require 'require-prof' if ENV["REQUIRE_PROF"]
|
46
63
|
require 'elasticsearch-transport'
|
@@ -56,17 +73,49 @@ if defined?(RUBY_VERSION) && RUBY_VERSION > '1.9'
|
|
56
73
|
require 'elasticsearch/extensions/test/profiling' unless JRUBY
|
57
74
|
end
|
58
75
|
|
59
|
-
class
|
60
|
-
def
|
76
|
+
class FixedMinitestSpecReporter < Minitest::Reporters::SpecReporter
|
77
|
+
def before_test(test)
|
78
|
+
last_test = tests.last
|
79
|
+
|
80
|
+
before_suite(test.class) unless last_test
|
81
|
+
|
82
|
+
if last_test && last_test.klass.to_s != test.class.to_s
|
83
|
+
after_suite(last_test.class) if last_test
|
84
|
+
before_suite(test.class)
|
85
|
+
end
|
61
86
|
end
|
87
|
+
end
|
62
88
|
|
63
|
-
|
89
|
+
module Minitest
|
90
|
+
class Test
|
91
|
+
def assert_nothing_raised(*args)
|
92
|
+
begin
|
93
|
+
line = __LINE__
|
94
|
+
yield
|
95
|
+
rescue RuntimeError => e
|
96
|
+
raise MiniTest::Assertion, "Exception raised:\n<#{e.class}>", e.backtrace
|
97
|
+
end
|
98
|
+
true
|
99
|
+
end
|
100
|
+
|
101
|
+
def assert_not_nil(object, msg=nil)
|
102
|
+
msg = message(msg) { "<#{object.inspect}> expected to not be nil" }
|
103
|
+
assert !object.nil?, msg
|
104
|
+
end
|
105
|
+
|
106
|
+
def assert_block(*msgs)
|
107
|
+
assert yield, *msgs
|
108
|
+
end
|
109
|
+
|
110
|
+
alias :assert_raise :assert_raises
|
64
111
|
end
|
65
112
|
end
|
66
113
|
|
114
|
+
Minitest::Reporters.use! FixedMinitestSpecReporter.new
|
115
|
+
|
67
116
|
module Elasticsearch
|
68
117
|
module Test
|
69
|
-
class IntegrationTestCase < ::Test
|
118
|
+
class IntegrationTestCase < Minitest::Test
|
70
119
|
extend Elasticsearch::Extensions::Test::StartupShutdown
|
71
120
|
|
72
121
|
shutdown { Elasticsearch::Extensions::Test::Cluster.stop if ENV['SERVER'] && started? && Elasticsearch::Extensions::Test::Cluster.running? }
|
@@ -75,7 +124,7 @@ module Elasticsearch
|
|
75
124
|
end
|
76
125
|
|
77
126
|
module Test
|
78
|
-
class ProfilingTest < ::Test
|
127
|
+
class ProfilingTest < Minitest::Test
|
79
128
|
extend Elasticsearch::Extensions::Test::StartupShutdown
|
80
129
|
extend Elasticsearch::Extensions::Test::Profiling
|
81
130
|
|
@@ -1,10 +1,23 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more
|
2
|
-
#
|
3
|
-
#
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
4
17
|
|
5
18
|
require 'test_helper'
|
6
19
|
|
7
|
-
class Elasticsearch::Transport::Transport::Connections::CollectionTest < Test
|
20
|
+
class Elasticsearch::Transport::Transport::Connections::CollectionTest < Minitest::Test
|
8
21
|
include Elasticsearch::Transport::Transport::Connections
|
9
22
|
|
10
23
|
context "Connection collection" do
|
@@ -1,10 +1,23 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more
|
2
|
-
#
|
3
|
-
#
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
4
17
|
|
5
18
|
require 'test_helper'
|
6
19
|
|
7
|
-
class Elasticsearch::Transport::Transport::Connections::SelectorTest < Test
|
20
|
+
class Elasticsearch::Transport::Transport::Connections::SelectorTest < Minitest::Test
|
8
21
|
include Elasticsearch::Transport::Transport::Connections::Selector
|
9
22
|
|
10
23
|
class DummyStrategySelector
|
@@ -1,10 +1,23 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more
|
2
|
-
#
|
3
|
-
#
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
4
17
|
|
5
18
|
require 'test_helper'
|
6
19
|
|
7
|
-
class Elasticsearch::Transport::Transport::Connections::ConnectionTest < Test
|
20
|
+
class Elasticsearch::Transport::Transport::Connections::ConnectionTest < Minitest::Test
|
8
21
|
include Elasticsearch::Transport::Transport::Connections
|
9
22
|
|
10
23
|
context "Connection" do
|
data/test/unit/response_test.rb
CHANGED
@@ -1,10 +1,23 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more
|
2
|
-
#
|
3
|
-
#
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
4
17
|
|
5
18
|
require 'test_helper'
|
6
19
|
|
7
|
-
class Elasticsearch::Transport::Transport::ResponseTest < Test
|
20
|
+
class Elasticsearch::Transport::Transport::ResponseTest < Minitest::Test
|
8
21
|
context "Response" do
|
9
22
|
|
10
23
|
should "force-encode the body into UTF" do
|
@@ -16,4 +29,4 @@ class Elasticsearch::Transport::Transport::ResponseTest < Test::Unit::TestCase
|
|
16
29
|
end unless RUBY_1_8
|
17
30
|
|
18
31
|
end
|
19
|
-
end
|
32
|
+
end
|
@@ -1,10 +1,23 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more
|
2
|
-
#
|
3
|
-
#
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
4
17
|
|
5
18
|
require 'test_helper'
|
6
19
|
|
7
|
-
class Elasticsearch::Transport::Transport::SerializerTest < Test
|
20
|
+
class Elasticsearch::Transport::Transport::SerializerTest < Minitest::Test
|
8
21
|
|
9
22
|
context "Serializer" do
|
10
23
|
|
@@ -1,10 +1,23 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more
|
2
|
-
#
|
3
|
-
#
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
4
17
|
|
5
18
|
require 'test_helper'
|
6
19
|
|
7
|
-
class Elasticsearch::Transport::Transport::BaseTest < Test
|
20
|
+
class Elasticsearch::Transport::Transport::BaseTest < Minitest::Test
|
8
21
|
|
9
22
|
class EmptyTransport
|
10
23
|
include Elasticsearch::Transport::Transport::Base
|
@@ -243,7 +256,7 @@ class Elasticsearch::Transport::Transport::BaseTest < Test::Unit::TestCase
|
|
243
256
|
@transport.expects(:get_connection).returns(stub_everything :failures => 1)
|
244
257
|
|
245
258
|
# `block.expects(:call).raises(::Errno::ECONNREFUSED)` fails on Ruby 1.8
|
246
|
-
block = lambda { |a,
|
259
|
+
block = lambda { |a,b| raise ::Errno::ECONNREFUSED }
|
247
260
|
|
248
261
|
assert_raise ::Errno::ECONNREFUSED do
|
249
262
|
@transport.perform_request 'GET', '/', &block
|
@@ -428,7 +441,7 @@ class Elasticsearch::Transport::Transport::BaseTest < Test::Unit::TestCase
|
|
428
441
|
@block = Proc.new { |c, u| puts "ERROR" }
|
429
442
|
@block.expects(:call).returns(Elasticsearch::Transport::Transport::Response.new 500, 'ERROR')
|
430
443
|
|
431
|
-
@transport.expects(:
|
444
|
+
@transport.expects(:__log_response)
|
432
445
|
@transport.logger.expects(:fatal)
|
433
446
|
|
434
447
|
assert_raise Elasticsearch::Transport::Transport::Errors::InternalServerError do
|
@@ -440,7 +453,7 @@ class Elasticsearch::Transport::Transport::BaseTest < Test::Unit::TestCase
|
|
440
453
|
@block = Proc.new { |c, u| puts "ERROR" }
|
441
454
|
@block.expects(:call).returns(Elasticsearch::Transport::Transport::Response.new 500, 'ERROR')
|
442
455
|
|
443
|
-
@transport.expects(:
|
456
|
+
@transport.expects(:__log_response).once
|
444
457
|
@transport.logger.expects(:fatal).never
|
445
458
|
|
446
459
|
# No `BadRequest` error
|
@@ -451,7 +464,7 @@ class Elasticsearch::Transport::Transport::BaseTest < Test::Unit::TestCase
|
|
451
464
|
@block = Proc.new { |c, u| puts "ERROR" }
|
452
465
|
@block.expects(:call).raises(Exception)
|
453
466
|
|
454
|
-
@transport.expects(:
|
467
|
+
@transport.expects(:__log_response).never
|
455
468
|
@transport.logger.expects(:fatal)
|
456
469
|
|
457
470
|
assert_raise(Exception) { @transport.perform_request('POST', '_search', &@block) }
|
@@ -1,6 +1,19 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more
|
2
|
-
#
|
3
|
-
#
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
4
17
|
|
5
18
|
require 'test_helper'
|
6
19
|
|
@@ -10,7 +23,7 @@ else
|
|
10
23
|
require 'elasticsearch/transport/transport/http/curb'
|
11
24
|
require 'curb'
|
12
25
|
|
13
|
-
class Elasticsearch::Transport::Transport::HTTP::FaradayTest < Test
|
26
|
+
class Elasticsearch::Transport::Transport::HTTP::FaradayTest < Minitest::Test
|
14
27
|
include Elasticsearch::Transport::Transport::HTTP
|
15
28
|
|
16
29
|
context "Curb transport" do
|
@@ -1,10 +1,23 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more
|
2
|
-
#
|
3
|
-
#
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
4
17
|
|
5
18
|
require 'test_helper'
|
6
19
|
|
7
|
-
class Elasticsearch::Transport::Transport::HTTP::FaradayTest < Test
|
20
|
+
class Elasticsearch::Transport::Transport::HTTP::FaradayTest < Minitest::Test
|
8
21
|
include Elasticsearch::Transport::Transport::HTTP
|
9
22
|
|
10
23
|
context "Faraday transport" do
|
@@ -1,6 +1,19 @@
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more
|
2
|
-
#
|
3
|
-
#
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
6
|
+
# not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
4
17
|
|
5
18
|
require 'test_helper'
|
6
19
|
|
@@ -11,7 +24,7 @@ else
|
|
11
24
|
require 'elasticsearch/transport/transport/http/manticore'
|
12
25
|
require 'manticore'
|
13
26
|
|
14
|
-
class Elasticsearch::Transport::Transport::HTTP::ManticoreTest < Test
|
27
|
+
class Elasticsearch::Transport::Transport::HTTP::ManticoreTest < Minitest::Test
|
15
28
|
include Elasticsearch::Transport::Transport::HTTP
|
16
29
|
|
17
30
|
context "Manticore transport" do
|
@@ -114,8 +127,13 @@ else
|
|
114
127
|
should "allow to set options for Manticore" do
|
115
128
|
options = { :headers => {"User-Agent" => "myapp-0.0" }}
|
116
129
|
transport = Manticore.new :hosts => [ { :host => 'foobar', :port => 1234 } ], :options => options
|
117
|
-
transport.connections.first.connection
|
118
|
-
|
130
|
+
transport.connections.first.connection
|
131
|
+
.expects(:get)
|
132
|
+
.with do |host, options|
|
133
|
+
assert_equal 'myapp-0.0', options[:headers]['User-Agent']
|
134
|
+
true
|
135
|
+
end
|
136
|
+
.returns(stub_everything)
|
119
137
|
|
120
138
|
transport.perform_request 'GET', '/', {}
|
121
139
|
end
|
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: 7.0.0.pre
|
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: 2019-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -28,18 +28,18 @@ dependencies:
|
|
28
28
|
name: faraday
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,21 +53,21 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '11.1'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '11.1'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: ansi
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: shoulda-context
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: mocha
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -109,21 +109,21 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: yard
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - "
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: pry
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
@@ -137,7 +137,7 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: curb
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
@@ -151,7 +151,7 @@ dependencies:
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
154
|
+
name: patron
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - ">="
|
@@ -165,21 +165,21 @@ dependencies:
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
168
|
+
name: typhoeus
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - "
|
171
|
+
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: '0'
|
173
|
+
version: '0.6'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- - "
|
178
|
+
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: '0'
|
180
|
+
version: '0.6'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
182
|
+
name: net-http-persistent
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
185
|
- - ">="
|
@@ -193,7 +193,7 @@ dependencies:
|
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
196
|
+
name: hashie
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
199
|
- - ">="
|
@@ -208,20 +208,6 @@ dependencies:
|
|
208
208
|
version: '0'
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: minitest
|
211
|
-
requirement: !ruby/object:Gem::Requirement
|
212
|
-
requirements:
|
213
|
-
- - "~>"
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
version: '4.0'
|
216
|
-
type: :development
|
217
|
-
prerelease: false
|
218
|
-
version_requirements: !ruby/object:Gem::Requirement
|
219
|
-
requirements:
|
220
|
-
- - "~>"
|
221
|
-
- !ruby/object:Gem::Version
|
222
|
-
version: '4.0'
|
223
|
-
- !ruby/object:Gem::Dependency
|
224
|
-
name: net-http-persistent
|
225
211
|
requirement: !ruby/object:Gem::Requirement
|
226
212
|
requirements:
|
227
213
|
- - ">="
|
@@ -235,27 +221,21 @@ dependencies:
|
|
235
221
|
- !ruby/object:Gem::Version
|
236
222
|
version: '0'
|
237
223
|
- !ruby/object:Gem::Dependency
|
238
|
-
name:
|
224
|
+
name: minitest-reporters
|
239
225
|
requirement: !ruby/object:Gem::Requirement
|
240
226
|
requirements:
|
241
|
-
- - "
|
242
|
-
- !ruby/object:Gem::Version
|
243
|
-
version: '0.17'
|
244
|
-
- - "<"
|
227
|
+
- - ">="
|
245
228
|
- !ruby/object:Gem::Version
|
246
|
-
version: '0
|
229
|
+
version: '0'
|
247
230
|
type: :development
|
248
231
|
prerelease: false
|
249
232
|
version_requirements: !ruby/object:Gem::Requirement
|
250
233
|
requirements:
|
251
|
-
- - "
|
252
|
-
- !ruby/object:Gem::Version
|
253
|
-
version: '0.17'
|
254
|
-
- - "<"
|
234
|
+
- - ">="
|
255
235
|
- !ruby/object:Gem::Version
|
256
|
-
version: '0
|
236
|
+
version: '0'
|
257
237
|
- !ruby/object:Gem::Dependency
|
258
|
-
name:
|
238
|
+
name: elasticsearch-extensions
|
259
239
|
requirement: !ruby/object:Gem::Requirement
|
260
240
|
requirements:
|
261
241
|
- - ">="
|
@@ -269,35 +249,35 @@ dependencies:
|
|
269
249
|
- !ruby/object:Gem::Version
|
270
250
|
version: '0'
|
271
251
|
- !ruby/object:Gem::Dependency
|
272
|
-
name:
|
252
|
+
name: ruby-prof
|
273
253
|
requirement: !ruby/object:Gem::Requirement
|
274
254
|
requirements:
|
275
|
-
- - "
|
255
|
+
- - ">="
|
276
256
|
- !ruby/object:Gem::Version
|
277
|
-
version: '
|
257
|
+
version: '0'
|
278
258
|
type: :development
|
279
259
|
prerelease: false
|
280
260
|
version_requirements: !ruby/object:Gem::Requirement
|
281
261
|
requirements:
|
282
|
-
- - "
|
262
|
+
- - ">="
|
283
263
|
- !ruby/object:Gem::Version
|
284
|
-
version: '
|
264
|
+
version: '0'
|
285
265
|
- !ruby/object:Gem::Dependency
|
286
|
-
name:
|
266
|
+
name: require-prof
|
287
267
|
requirement: !ruby/object:Gem::Requirement
|
288
268
|
requirements:
|
289
|
-
- - "
|
269
|
+
- - ">="
|
290
270
|
- !ruby/object:Gem::Version
|
291
|
-
version: '
|
271
|
+
version: '0'
|
292
272
|
type: :development
|
293
273
|
prerelease: false
|
294
274
|
version_requirements: !ruby/object:Gem::Requirement
|
295
275
|
requirements:
|
296
|
-
- - "
|
276
|
+
- - ">="
|
297
277
|
- !ruby/object:Gem::Version
|
298
|
-
version: '
|
278
|
+
version: '0'
|
299
279
|
- !ruby/object:Gem::Dependency
|
300
|
-
name:
|
280
|
+
name: simplecov
|
301
281
|
requirement: !ruby/object:Gem::Requirement
|
302
282
|
requirements:
|
303
283
|
- - ">="
|
@@ -311,7 +291,7 @@ dependencies:
|
|
311
291
|
- !ruby/object:Gem::Version
|
312
292
|
version: '0'
|
313
293
|
- !ruby/object:Gem::Dependency
|
314
|
-
name:
|
294
|
+
name: simplecov-rcov
|
315
295
|
requirement: !ruby/object:Gem::Requirement
|
316
296
|
requirements:
|
317
297
|
- - ">="
|
@@ -325,7 +305,7 @@ dependencies:
|
|
325
305
|
- !ruby/object:Gem::Version
|
326
306
|
version: '0'
|
327
307
|
- !ruby/object:Gem::Dependency
|
328
|
-
name:
|
308
|
+
name: cane
|
329
309
|
requirement: !ruby/object:Gem::Requirement
|
330
310
|
requirements:
|
331
311
|
- - ">="
|
@@ -339,19 +319,19 @@ dependencies:
|
|
339
319
|
- !ruby/object:Gem::Version
|
340
320
|
version: '0'
|
341
321
|
- !ruby/object:Gem::Dependency
|
342
|
-
name:
|
322
|
+
name: test-unit
|
343
323
|
requirement: !ruby/object:Gem::Requirement
|
344
324
|
requirements:
|
345
|
-
- - "
|
325
|
+
- - "~>"
|
346
326
|
- !ruby/object:Gem::Version
|
347
|
-
version: '
|
327
|
+
version: '2'
|
348
328
|
type: :development
|
349
329
|
prerelease: false
|
350
330
|
version_requirements: !ruby/object:Gem::Requirement
|
351
331
|
requirements:
|
352
|
-
- - "
|
332
|
+
- - "~>"
|
353
333
|
- !ruby/object:Gem::Version
|
354
|
-
version: '
|
334
|
+
version: '2'
|
355
335
|
description: 'Ruby client for Elasticsearch. See the `elasticsearch` gem for full
|
356
336
|
integration.
|
357
337
|
|
@@ -382,13 +362,13 @@ files:
|
|
382
362
|
- lib/elasticsearch/transport/transport/http/curb.rb
|
383
363
|
- lib/elasticsearch/transport/transport/http/faraday.rb
|
384
364
|
- lib/elasticsearch/transport/transport/http/manticore.rb
|
365
|
+
- lib/elasticsearch/transport/transport/loggable.rb
|
385
366
|
- lib/elasticsearch/transport/transport/response.rb
|
386
367
|
- lib/elasticsearch/transport/transport/serializer/multi_json.rb
|
387
368
|
- lib/elasticsearch/transport/transport/sniffer.rb
|
388
369
|
- lib/elasticsearch/transport/version.rb
|
389
370
|
- spec/elasticsearch/transport/base_spec.rb
|
390
371
|
- spec/elasticsearch/transport/client_spec.rb
|
391
|
-
- spec/elasticsearch/transport/meta_header_spec.rb
|
392
372
|
- spec/elasticsearch/transport/sniffer_spec.rb
|
393
373
|
- spec/spec_helper.rb
|
394
374
|
- test/integration/transport_test.rb
|
@@ -403,14 +383,10 @@ files:
|
|
403
383
|
- test/unit/transport_curb_test.rb
|
404
384
|
- test/unit/transport_faraday_test.rb
|
405
385
|
- test/unit/transport_manticore_test.rb
|
406
|
-
homepage: https://
|
386
|
+
homepage: https://github.com/elasticsearch/elasticsearch-ruby/tree/master/elasticsearch-transport
|
407
387
|
licenses:
|
408
388
|
- Apache-2.0
|
409
|
-
metadata:
|
410
|
-
homepage_uri: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/index.html
|
411
|
-
changelog_uri: https://github.com/elastic/elasticsearch-ruby/blob/6.x/CHANGELOG.md
|
412
|
-
source_code_uri: https://github.com/elastic/elasticsearch-ruby/tree/6.x/elasticsearch-transport
|
413
|
-
bug_tracker_uri: https://github.com/elastic/elasticsearch-ruby/issues
|
389
|
+
metadata: {}
|
414
390
|
post_install_message:
|
415
391
|
rdoc_options:
|
416
392
|
- "--charset=UTF-8"
|
@@ -420,21 +396,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
420
396
|
requirements:
|
421
397
|
- - ">="
|
422
398
|
- !ruby/object:Gem::Version
|
423
|
-
version: '
|
399
|
+
version: '1.9'
|
424
400
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
425
401
|
requirements:
|
426
|
-
- - "
|
402
|
+
- - ">"
|
427
403
|
- !ruby/object:Gem::Version
|
428
|
-
version:
|
404
|
+
version: 1.3.1
|
429
405
|
requirements: []
|
430
|
-
rubygems_version: 3.
|
406
|
+
rubygems_version: 3.0.3
|
431
407
|
signing_key:
|
432
408
|
specification_version: 4
|
433
409
|
summary: Ruby client for Elasticsearch.
|
434
410
|
test_files:
|
435
411
|
- spec/elasticsearch/transport/base_spec.rb
|
436
412
|
- spec/elasticsearch/transport/client_spec.rb
|
437
|
-
- spec/elasticsearch/transport/meta_header_spec.rb
|
438
413
|
- spec/elasticsearch/transport/sniffer_spec.rb
|
439
414
|
- spec/spec_helper.rb
|
440
415
|
- test/integration/transport_test.rb
|