Skip to content

Commit 5e1a3ac

Browse files
committed
[API] Fix clear_indices in test_file to actually delete all indices
1 parent ef4e705 commit 5e1a3ac

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

api-spec-testing/test_file.rb

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -195,31 +195,7 @@ def clear_transforms(client)
195195
end
196196

197197
def clear_indices(client)
198-
indices = client.indices.get(index: '_all').keys.reject do |i|
199-
i.start_with?('.security') || i.start_with?('.watches')
200-
end
201-
indices.each do |index|
202-
client.indices.delete_alias(index: index, name: '*', ignore: 404)
203-
client.indices.delete(index: index, ignore: 404)
204-
end
205-
# See cat.aliases/10_basic.yml, test_index is not return in client.indices.get(index: '_all')
206-
client.indices.delete(index: 'index_to_monitor', ignore: 404)
207-
client.indices.delete(index: 'index3', ignore: 404)
208-
client.indices.delete(index: 'test-close', ignore: 404)
209-
client.indices.delete(index: 'test_closed', ignore: 404)
210-
client.indices.delete(index: 'index', ignore: 404)
211-
client.indices.delete(index: 'index2', ignore: 404)
212-
client.indices.delete(index: 'test', ignore: 404)
213-
client.indices.delete(index: 'test_2', ignore: 404)
214-
client.indices.delete(index: 'index-2', ignore: 404)
215-
client.indices.delete(index: 'test_index', ignore: 404)
216-
client.indices.delete(index: 'index1', ignore: 404)
217-
client.indices.delete(index: 'index_closed', ignore: 404)
218-
client.indices.delete(index: 'bar', ignore: 404)
219-
client.indices.delete(index: 'test_close_index', ignore: 404)
220-
client.indices.delete(index: 'test_index_3', ignore: 404)
221-
client.indices.delete(index: 'test_index_2', ignore: 404)
222-
client.indices.delete(index: 'test-xyy', ignore: 404)
198+
client.indices.delete(index: '*')
223199
end
224200
end
225201
end

0 commit comments

Comments
 (0)