module Elasticsearch::Extensions::Test::Cluster
A convenience Ruby class for starting and stopping an Elasticsearch
cluster, eg. for integration tests
@example Start a cluster with default configuration,
assuming `elasticsearch` is on $PATH. require 'elasticsearch/extensions/test/cluster' Elasticsearch::Extensions::Test::Cluster.start
@example Start a cluster with a specific Elasticsearch
launch script,
eg. from a downloaded `.tar.gz` distribution system 'wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.1.tar.gz' system 'tar -xvf elasticsearch-5.1.1.tar.gz' require 'elasticsearch/extensions/test/cluster' Elasticsearch::Extensions::Test::Cluster.start command: 'elasticsearch-5.1.1/bin/elasticsearch'
@see Cluster#initialize
Public Class Methods
running?(arguments = {})
click to toggle source
Returns true when a specific test node is running within the cluster
@see Cluster#running?
# File lib/elasticsearch/extensions/test/cluster.rb, line 82 def running?(arguments = {}) Cluster.new(arguments).running? end
start(arguments = {})
click to toggle source
Starts a cluster
@see Cluster#start
# File lib/elasticsearch/extensions/test/cluster.rb, line 66 def start(arguments = {}) Cluster.new(arguments).start end
stop(arguments = {})
click to toggle source
Stops a cluster
@see Cluster#stop
# File lib/elasticsearch/extensions/test/cluster.rb, line 74 def stop(arguments = {}) Cluster.new(arguments).stop end
wait_for_green(arguments = {})
click to toggle source
Waits until the cluster is green and prints information
# File lib/elasticsearch/extensions/test/cluster.rb, line 90 def wait_for_green(arguments = {}) Cluster.new(arguments).wait_for_green end
Private Instance Methods
running?(arguments = {})
click to toggle source
Returns true when a specific test node is running within the cluster
@see Cluster#running?
# File lib/elasticsearch/extensions/test/cluster.rb, line 82 def running?(arguments = {}) Cluster.new(arguments).running? end
start(arguments = {})
click to toggle source
Starts a cluster
@see Cluster#start
# File lib/elasticsearch/extensions/test/cluster.rb, line 66 def start(arguments = {}) Cluster.new(arguments).start end
stop(arguments = {})
click to toggle source
Stops a cluster
@see Cluster#stop
# File lib/elasticsearch/extensions/test/cluster.rb, line 74 def stop(arguments = {}) Cluster.new(arguments).stop end
wait_for_green(arguments = {})
click to toggle source
Waits until the cluster is green and prints information
# File lib/elasticsearch/extensions/test/cluster.rb, line 90 def wait_for_green(arguments = {}) Cluster.new(arguments).wait_for_green end