@@ -38,7 +38,6 @@ def ansi(*args)
38
38
module Elasticsearch
39
39
module Extensions
40
40
module Test
41
-
42
41
# A convenience Ruby class for starting and stopping an Elasticsearch cluster,
43
42
# eg. for integration tests
44
43
#
@@ -60,36 +59,35 @@ module Test
60
59
# @see Cluster#initialize
61
60
#
62
61
module Cluster
63
-
64
62
# Starts a cluster
65
63
#
66
64
# @see Cluster#start
67
65
#
68
- def start ( arguments = { } )
66
+ def start ( arguments = { } )
69
67
Cluster . new ( arguments ) . start
70
68
end
71
69
72
70
# Stops a cluster
73
71
#
74
72
# @see Cluster#stop
75
73
#
76
- def stop ( arguments = { } )
74
+ def stop ( arguments = { } )
77
75
Cluster . new ( arguments ) . stop
78
76
end
79
77
80
78
# Returns true when a specific test node is running within the cluster
81
79
#
82
80
# @see Cluster#running?
83
81
#
84
- def running? ( arguments = { } )
82
+ def running? ( arguments = { } )
85
83
Cluster . new ( arguments ) . running?
86
84
end
87
85
88
86
# Waits until the cluster is green and prints information
89
87
#
90
88
# @see Cluster#wait_for_green
91
89
#
92
- def wait_for_green ( arguments = { } )
90
+ def wait_for_green ( arguments = { } )
93
91
Cluster . new ( arguments ) . wait_for_green
94
92
end
95
93
@@ -215,6 +213,7 @@ class Cluster
215
213
}
216
214
}
217
215
COMMANDS [ '7.0' ] = COMMANDS [ '6.0' ] . clone
216
+ COMMANDS [ '8.0' ] = COMMANDS [ '7.0' ] . clone
218
217
COMMANDS . freeze
219
218
220
219
# Create a new instance of the Cluster class
@@ -430,7 +429,7 @@ def __default_network_host
430
429
'0.0.0.0'
431
430
when /^2/
432
431
'_local_'
433
- when /^5|^6|^7/
432
+ when /^5|^6|^7|^8 /
434
433
'_local_'
435
434
else
436
435
raise RuntimeError , "Cannot determine default network host from version [#{ version } ]"
@@ -473,6 +472,7 @@ def __cluster_url
473
472
#
474
473
def __determine_version
475
474
path_to_lib = File . dirname ( arguments [ :command ] ) + '/../lib/'
475
+
476
476
version = if arguments [ :version ]
477
477
arguments [ :version ]
478
478
elsif File . exist? ( path_to_lib ) && !( jar = Dir . entries ( path_to_lib ) . select { |f | f =~ /^elasticsearch\- \d / } . first ) . nil?
@@ -550,6 +550,8 @@ def __determine_version
550
550
'6.0'
551
551
when /^7\. .*/
552
552
'7.0'
553
+ when /^8\. .*/
554
+ '8.0'
553
555
else
554
556
raise RuntimeError , "Cannot determine major version from [#{ version } ]"
555
557
end
0 commit comments