elasticsearch-extensions 0.0.24 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7248c6fbddfe31ef013db4c097d59ba4427df2e3
4
- data.tar.gz: 565df7537b10de2a83cbf0181a65b7580901ba83
3
+ metadata.gz: 8bda497e1ccc47c049c768553dd2a5abeab9c2c0
4
+ data.tar.gz: 22b39cc0d3a681d4247dd1f680ab0b03186dd6e4
5
5
  SHA512:
6
- metadata.gz: 5d56926d940b28be59070ab4d98adaba0beedb9228ca8df892db425e9066342bb54b29ed6f4ef7b94b6f1d94214df876e451aae3313092ef1c277b20d8241266
7
- data.tar.gz: 397ab511b86ae27c15c77037df6c8d598e618299bf1683d7927c0cb6bc72823e7a212285ae052c7d1d613bdabdd6518fcdcb74a3f7a3ed4c4b5436117f859158
6
+ metadata.gz: 692fc9fed953ce3c5bfce9e4c736ec93a495c6da474003a6e7123edae6f62eefcfb9f5ac3aedb199b7d4d68110d3e21c5ec283844f68ff8f621f0d47f01681ac
7
+ data.tar.gz: 64ea85038c2195bb9eeecf3cc6c8eea2c9f9bf6c0abfa79f3bd370079b7c4940fa8db9b28c4f6f404cfcb942941ba9a0914d630af0ca4abc8f12c5fcad978748
data/Rakefile CHANGED
@@ -23,14 +23,16 @@ namespace :test do
23
23
  Rake::Task['test:ci_reporter'].invoke if ENV['CI']
24
24
  test.libs << 'lib' << 'test'
25
25
  test.test_files = FileList["test/**/unit/**/*_test.rb"]
26
- # test.verbose = true
27
- # test.warning = true
26
+ test.verbose = false
27
+ test.warning = false
28
28
  end
29
29
 
30
30
  Rake::TestTask.new(:integration) do |test|
31
31
  Rake::Task['test:ci_reporter'].invoke if ENV['CI']
32
32
  test.libs << 'lib' << 'test'
33
33
  test.test_files = FileList["test/**/integration/**/*_test.rb"]
34
+ test.verbose = false
35
+ test.warning = false
34
36
  end
35
37
 
36
38
  Rake::TestTask.new(:all) do |test|
@@ -83,7 +83,7 @@ module Elasticsearch
83
83
 
84
84
  COMMANDS = {
85
85
  '0.90' => lambda { |arguments, node_number|
86
- <<-COMMAND.gsub(/ /, '')
86
+ <<-COMMAND.gsub(/ /, '').gsub(/\n$/, '')
87
87
  #{arguments[:command]} \
88
88
  -f \
89
89
  -D es.cluster.name=#{arguments[:cluster_name]} \
@@ -102,14 +102,13 @@ module Elasticsearch
102
102
  -D es.node.bench=true \
103
103
  -D es.path.repo=/tmp \
104
104
  -D es.repositories.url.allowed_urls=http://snapshot.test* \
105
- -D es.logger.level=DEBUG \
106
- #{arguments[:es_params]} \
107
- > /dev/null
105
+ -D es.logger.level=#{ENV['DEBUG'] ? 'DEBUG' : 'INFO'} \
106
+ #{arguments[:es_params]}
108
107
  COMMAND
109
108
  },
110
109
 
111
110
  '1.0' => lambda { |arguments, node_number|
112
- <<-COMMAND.gsub(/ /, '')
111
+ <<-COMMAND.gsub(/ /, '').gsub(/\n$/, '')
113
112
  #{arguments[:command]} \
114
113
  -D es.foreground=yes \
115
114
  -D es.cluster.name=#{arguments[:cluster_name]} \
@@ -129,13 +128,12 @@ module Elasticsearch
129
128
  -D es.path.repo=/tmp \
130
129
  -D es.repositories.url.allowed_urls=http://snapshot.test* \
131
130
  -D es.logger.level=#{ENV['DEBUG'] ? 'DEBUG' : 'INFO'} \
132
- #{arguments[:es_params]} \
133
- > /dev/null
131
+ #{arguments[:es_params]}
134
132
  COMMAND
135
133
  },
136
134
 
137
135
  '2.0' => lambda { |arguments, node_number|
138
- <<-COMMAND.gsub(/ /, '')
136
+ <<-COMMAND.gsub(/ /, '').gsub(/\n$/, '')
139
137
  #{arguments[:command]} \
140
138
  -D es.foreground=yes \
141
139
  -D es.cluster.name=#{arguments[:cluster_name]} \
@@ -151,14 +149,13 @@ module Elasticsearch
151
149
  -D es.node.attr.testattr=test \
152
150
  -D es.path.repo=/tmp \
153
151
  -D es.repositories.url.allowed_urls=http://snapshot.test* \
154
- -D es.logger.level=DEBUG \
155
- #{arguments[:es_params]} \
156
- > /dev/null
152
+ -D es.logger.level=#{ENV['DEBUG'] ? 'DEBUG' : 'INFO'} \
153
+ #{arguments[:es_params]}
157
154
  COMMAND
158
155
  },
159
156
 
160
157
  '5.0' => lambda { |arguments, node_number|
161
- <<-COMMAND.gsub(/ /, '')
158
+ <<-COMMAND.gsub(/ /, '').gsub(/\n$/, '')
162
159
  #{arguments[:command]} \
163
160
  -E cluster.name=#{arguments[:cluster_name]} \
164
161
  -E node.name=#{arguments[:node_name]}-#{node_number} \
@@ -174,9 +171,8 @@ module Elasticsearch
174
171
  -E repositories.url.allowed_urls=http://snapshot.test* \
175
172
  -E discovery.zen.minimum_master_nodes=#{arguments[:number_of_nodes]-1} \
176
173
  -E node.max_local_storage_nodes=#{arguments[:number_of_nodes]} \
177
- -E logger.level=DEBUG \
178
- #{arguments[:es_params]} \
179
- > /dev/null
174
+ -E logger.level=#{ENV['DEBUG'] ? 'DEBUG' : 'INFO'} \
175
+ #{arguments[:es_params]}
180
176
  COMMAND
181
177
  }
182
178
  }
@@ -194,7 +190,7 @@ module Elasticsearch
194
190
  # @option arguments [String] :path_work Path to the directory with auxiliary files
195
191
  # @option arguments [String] :path_logs Path to the directory with log files
196
192
  # @option arguments [Boolean] :multicast_enabled Whether multicast is enabled (default: true)
197
- # @option arguments [Integer] :timeout Timeout when starting the cluster (default: 30)
193
+ # @option arguments [Integer] :timeout Timeout when starting the cluster (default: 60)
198
194
  # @option arguments [String] :network_host The host that nodes will bind on and publish to
199
195
  # @option arguments [Boolean] :clear_cluster Wipe out cluster content on startup (default: true)
200
196
  # @option arguments [Boolean] :quiet Disable printing to STDERR (default: false)
@@ -215,7 +211,7 @@ module Elasticsearch
215
211
  @arguments[:path_logs] ||= ENV.fetch('TEST_CLUSTER_LOGS', '/tmp/log/elasticsearch')
216
212
  @arguments[:es_params] ||= ENV.fetch('TEST_CLUSTER_PARAMS', '')
217
213
  @arguments[:multicast_enabled] ||= ENV.fetch('TEST_CLUSTER_MULTICAST', 'true')
218
- @arguments[:timeout] ||= ENV.fetch('TEST_CLUSTER_TIMEOUT', 30).to_i
214
+ @arguments[:timeout] ||= ENV.fetch('TEST_CLUSTER_TIMEOUT', 60).to_i
219
215
  @arguments[:number_of_nodes] ||= ENV.fetch('TEST_CLUSTER_NODES', 2).to_i
220
216
  @arguments[:network_host] ||= ENV.fetch('TEST_CLUSTER_NETWORK_HOST', __default_network_host)
221
217
  @arguments[:quiet] ||= ! ENV.fetch('QUIET', '').empty?
@@ -268,7 +264,10 @@ module Elasticsearch
268
264
 
269
265
  arguments[:number_of_nodes].times do |n|
270
266
  n += 1
267
+
271
268
  command = __command(version, arguments, n)
269
+ command += '> /dev/null' unless ENV['DEBUG']
270
+
272
271
  __log command.gsub(/ {1,}/, ' ').ansi(:bold) if ENV['DEBUG']
273
272
 
274
273
  pid = Process.spawn(command)
@@ -362,7 +361,7 @@ module Elasticsearch
362
361
  # @return Boolean
363
362
  #
364
363
  def wait_for_green
365
- __wait_for_status('green', 60)
364
+ __wait_for_status('green', arguments[:timeout])
366
365
  end
367
366
 
368
367
  # Returns the major version of Elasticsearch
@@ -584,8 +583,9 @@ module Elasticsearch
584
583
  'Nodes: '.ljust(20).ansi(:faint) + health['number_of_nodes'].to_s.ansi(:faint)].join("\n")
585
584
 
586
585
  nodes['nodes'].each do |id, info|
587
- m = id == master ? '*' : '+'
588
- result << ''.ljust(20) +
586
+ m = id == master ? '*' : '-'
587
+ result << "\n" +
588
+ ''.ljust(20) +
589
589
  "#{m} ".ansi(:faint) +
590
590
  "#{info['name'].ansi(:bold)} ".ansi(:faint) +
591
591
  "| version: #{info['version'] rescue 'N/A'}, ".ansi(:faint) +
@@ -1,5 +1,5 @@
1
1
  module Elasticsearch
2
2
  module Extensions
3
- VERSION = "0.0.24"
3
+ VERSION = "0.0.25"
4
4
  end
5
5
  end
@@ -24,7 +24,7 @@ class Elasticsearch::Extensions::TestClusterTest < Test::Unit::TestCase
24
24
  setup do
25
25
  Elasticsearch::Extensions::Test::Cluster::Cluster.any_instance.stubs(:__default_network_host).returns('_local_')
26
26
 
27
- @subject = Elasticsearch::Extensions::Test::Cluster::Cluster.new
27
+ @subject = Elasticsearch::Extensions::Test::Cluster::Cluster.new(number_of_nodes: 1)
28
28
  @subject.stubs(:__remove_cluster_data).returns(true)
29
29
  end
30
30
 
@@ -262,11 +262,7 @@ class Elasticsearch::Extensions::TestClusterTest < Test::Unit::TestCase
262
262
  File.expects(:exist?).with('/foo/bar/bin/elasticsearch').returns(true)
263
263
 
264
264
  Process.stubs(:wait)
265
- Process.expects(:spawn)
266
- .with do |command, options|
267
- assert_equal "/foo/bar/bin/elasticsearch --version", command
268
- end
269
- .returns(123)
265
+ Process.expects(:spawn).returns(123)
270
266
  Process.expects(:kill).with('INT', 123)
271
267
 
272
268
  IO.any_instance.expects(:read)
@@ -288,11 +284,7 @@ class Elasticsearch::Extensions::TestClusterTest < Test::Unit::TestCase
288
284
  File.expects(:exist?).with('/foo/bar/bin/elasticsearch').returns(true)
289
285
 
290
286
  Process.stubs(:wait)
291
- Process.expects(:spawn)
292
- .with do |command, options|
293
- assert_equal "/foo/bar/bin/elasticsearch --version", command
294
- end
295
- .returns(123)
287
+ Process.expects(:spawn).returns(123)
296
288
  Process.expects(:kill).with('INT', 123)
297
289
 
298
290
  IO.any_instance.expects(:read).returns('Version: FOOBAR')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24
4
+ version: 0.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-21 00:00:00.000000000 Z
11
+ date: 2017-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ansi