Module: Elasticsearch::Extensions::Test::Cluster
- Defined in:
- lib/elasticsearch/extensions/test/cluster.rb
Overview
A convenience Ruby class for starting and stopping an Elasticsearch cluster, eg. for integration tests
require 'elasticsearch/extensions/test/cluster'
Elasticsearch::Extensions::Test::Cluster.start
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'
Defined Under Namespace
Classes: Cluster
Class Method Summary collapse
-
.running?(arguments = {}) ⇒ Boolean
Returns true when a specific test node is running within the cluster.
-
.start(arguments = {}) ⇒ Object
Starts a cluster.
-
.stop(arguments = {}) ⇒ Object
Stops a cluster.
-
.wait_for_green(arguments = {}) ⇒ Object
Waits until the cluster is green and prints information.
Class Method Details
.running?(arguments = {}) ⇒ Boolean
Returns true when a specific test node is running within the cluster
67 68 69 |
# File 'lib/elasticsearch/extensions/test/cluster.rb', line 67 def running?(arguments={}) Cluster.new(arguments).running? end |
.start(arguments = {}) ⇒ Object
Starts a cluster
51 52 53 |
# File 'lib/elasticsearch/extensions/test/cluster.rb', line 51 def start(arguments={}) Cluster.new(arguments).start end |
.stop(arguments = {}) ⇒ Object
Stops a cluster
59 60 61 |
# File 'lib/elasticsearch/extensions/test/cluster.rb', line 59 def stop(arguments={}) Cluster.new(arguments).stop end |
.wait_for_green(arguments = {}) ⇒ Object
Waits until the cluster is green and prints information
75 76 77 |
# File 'lib/elasticsearch/extensions/test/cluster.rb', line 75 def wait_for_green(arguments={}) Cluster.new(arguments).wait_for_green end |