File tree Expand file tree Collapse file tree 2 files changed +36
-8
lines changed
elasticsearch-api/api-spec-testing Expand file tree Collapse file tree 2 files changed +36
-8
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
+ module Elasticsearch
19
+ module RestAPIYAMLTests
20
+ # Custom functions for wipe cluster
21
+ module CustomCleanup
22
+ class << self
23
+ def wipe_calendars ( client )
24
+ calendars = client . ml . get_calendars ( calendar_id : '_all' ) . body [ 'calendars' ]
25
+ calendars . each do |calendar |
26
+ client . ml . delete_calendar ( calendar_id : calendar [ 'calendar_id' ] )
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
Original file line number Diff line number Diff line change 16
16
# under the License.
17
17
18
18
require_relative 'logging'
19
+ require_relative 'custom_cleanup'
19
20
include Elasticsearch ::RestAPIYAMLTests ::Logging
20
21
21
22
module Elasticsearch
@@ -79,20 +80,15 @@ def wipe_cluster(client)
79
80
# clear_ml_filters(client)
80
81
# clear_tasks(client)
81
82
# clear_transforms(client)
82
- wipe_calendars ( client )
83
+
84
+ # Custom implementations
85
+ CustomCleanup ::wipe_calendars ( client )
83
86
end
84
87
85
88
def ensure_no_initializing_shards ( client )
86
89
client . cluster . health ( wait_for_no_initializing_shards : true , timeout : '70s' , level : 'shards' )
87
90
end
88
91
89
- def wipe_calendars ( client )
90
- calendars = client . ml . get_calendars ( calendar_id : '_all' ) . body [ 'calendars' ]
91
- calendars . each do |calendar |
92
- client . ml . delete_calendar ( calendar_id : calendar [ 'calendar_id' ] )
93
- end
94
- end
95
-
96
92
def check_for_unexpectedly_recreated_objects ( client )
97
93
unexpected_ilm_policies = client . index_lifecycle_management . get_lifecycle
98
94
unexpected_ilm_policies . reject! { |k , _ | PRESERVE_ILM_POLICY_IDS . include? k }
You can’t perform that action at this time.
0 commit comments