File tree Expand file tree Collapse file tree 3 files changed +35
-4
lines changed
elasticsearch-xpack/spec/xpack Expand file tree Collapse file tree 3 files changed +35
-4
lines changed Original file line number Diff line number Diff line change
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.
17
+
18
+ require 'logger'
19
+
20
+ module Elasticsearch
21
+ module RestAPIYAMLTests
22
+ module Logging
23
+ def logger
24
+ @logger ||= Logger . new ( $stdout)
25
+ end
26
+ end
27
+ end
28
+ end
Original file line number Diff line number Diff line change 15
15
# specific language governing permissions and limitations
16
16
# under the License.
17
17
18
+ require_relative 'logging'
19
+ include Elasticsearch ::RestAPIYAMLTests ::Logging
20
+
18
21
module Elasticsearch
19
22
module RestAPIYAMLTests
20
23
module WipeCluster
@@ -81,7 +84,7 @@ def wait_for_pending_tasks(client)
81
84
results . each do |task |
82
85
next if task . empty?
83
86
84
- LOGGER . debug "Pending task: #{ task } "
87
+ logger . debug "Pending task: #{ task } "
85
88
count += 1 if task . include? ( filter )
86
89
end
87
90
break unless count . positive? && Time . now . to_i < ( time + 30 )
@@ -97,7 +100,7 @@ def wait_for_cluster_tasks(client)
97
100
results [ 'tasks' ] . each do |task |
98
101
next if task . empty?
99
102
100
- LOGGER . debug "Pending cluster task: #{ task } "
103
+ logger . debug "Pending cluster task: #{ task } "
101
104
count += 1
102
105
end
103
106
break unless count . positive? && Time . now . to_i < ( time + 30 )
@@ -286,7 +289,7 @@ def clear_datastreams(client)
286
289
begin
287
290
client . xpack . indices . delete_data_stream ( name : '*' , expand_wildcards : 'all' )
288
291
rescue StandardError => e
289
- LOGGER . error "Caught exception attempting to delete data streams: #{ e } "
292
+ logger . error "Caught exception attempting to delete data streams: #{ e } "
290
293
client . xpack . indices . delete_data_stream ( name : '*' )
291
294
end
292
295
end
Original file line number Diff line number Diff line change 69
69
70
70
after ( :all ) do
71
71
test_file . teardown
72
- Elasticsearch ::RestAPIYAMLTests ::TestFile . wipe_cluster ( ADMIN_CLIENT )
72
+ Elasticsearch ::RestAPIYAMLTests ::WipeCluster . run ( ADMIN_CLIENT )
73
73
end
74
74
75
75
test . task_groups . each do |task_group |
You can’t perform that action at this time.
0 commit comments