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 1616# under the License.
1717
1818require_relative 'logging'
19+ require_relative 'custom_cleanup'
1920include Elasticsearch ::RestAPIYAMLTests ::Logging
2021
2122module Elasticsearch
@@ -79,20 +80,15 @@ def wipe_cluster(client)
7980 # clear_ml_filters(client)
8081 # clear_tasks(client)
8182 # clear_transforms(client)
82- wipe_calendars ( client )
83+
84+ # Custom implementations
85+ CustomCleanup ::wipe_calendars ( client )
8386 end
8487
8588 def ensure_no_initializing_shards ( client )
8689 client . cluster . health ( wait_for_no_initializing_shards : true , timeout : '70s' , level : 'shards' )
8790 end
8891
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-
9692 def check_for_unexpectedly_recreated_objects ( client )
9793 unexpected_ilm_policies = client . index_lifecycle_management . get_lifecycle
9894 unexpected_ilm_policies . reject! { |k , _ | PRESERVE_ILM_POLICY_IDS . include? k }
You can’t perform that action at this time.
0 commit comments