File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
elasticsearch-xpack/spec/xpack Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,9 @@ def clear_data_xpack(client)
111
111
clear_rollup_jobs ( client )
112
112
clear_tasks ( client )
113
113
clear_machine_learning_indices ( client )
114
- create_x_pack_rest_user ( client )
115
- clear_data ( client )
114
+ clear_indices_xpack ( client )
115
+ clear_index_templates ( client )
116
+ clear_snapshots_and_repositories ( client )
116
117
clear_transforms ( client )
117
118
end
118
119
@@ -197,6 +198,16 @@ def clear_transforms(client)
197
198
def clear_indices ( client )
198
199
client . indices . delete ( index : '*' )
199
200
end
201
+
202
+ def clear_indices_xpack ( client )
203
+ indices = client . indices . get ( index : '_all' ) . keys . reject do |i |
204
+ i . start_with? ( '.security' ) || i . start_with? ( '.watches' )
205
+ end
206
+ indices . each do |index |
207
+ client . indices . delete_alias ( index : index , name : '*' , ignore : 404 )
208
+ client . indices . delete ( index : index , ignore : 404 )
209
+ end
210
+ end
200
211
end
201
212
end
202
213
end
Original file line number Diff line number Diff line change 12
12
test_file = Elasticsearch ::RestAPIYAMLTests ::TestFile . new ( file , REST_API_YAML_SKIP_FEATURES )
13
13
14
14
context "#{ file . gsub ( "#{ YAML_FILES_DIRECTORY } /" , '' ) } " do
15
-
16
15
before ( :all ) do
17
16
# Runs once before all tests in a test file
18
17
Elasticsearch ::RestAPIYAMLTests ::TestFile . clear_data_xpack ( ADMIN_CLIENT )
19
18
end
20
19
21
20
test_file . tests . each do |test |
22
-
23
21
context "#{ test . description } " do
24
-
25
22
if test . skip_test? ( ADMIN_CLIENT )
26
23
skip 'Test contains feature(s) not yet supported or version is not satisfied'
27
-
28
24
else
29
25
30
26
let ( :client ) do
You can’t perform that action at this time.
0 commit comments