Skip to content

Commit 174a169

Browse files
committed
[X-Pack] Specific cleanup for x-pack
1 parent 5e1a3ac commit 174a169

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

api-spec-testing/test_file.rb

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ def clear_data_xpack(client)
111111
clear_rollup_jobs(client)
112112
clear_tasks(client)
113113
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)
116117
clear_transforms(client)
117118
end
118119

@@ -197,6 +198,16 @@ def clear_transforms(client)
197198
def clear_indices(client)
198199
client.indices.delete(index: '*')
199200
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
200211
end
201212
end
202213
end

elasticsearch-xpack/spec/xpack/rest_api_yaml_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,15 @@
1212
test_file = Elasticsearch::RestAPIYAMLTests::TestFile.new(file, REST_API_YAML_SKIP_FEATURES)
1313

1414
context "#{file.gsub("#{YAML_FILES_DIRECTORY}/", '')}" do
15-
1615
before(:all) do
1716
# Runs once before all tests in a test file
1817
Elasticsearch::RestAPIYAMLTests::TestFile.clear_data_xpack(ADMIN_CLIENT)
1918
end
2019

2120
test_file.tests.each do |test|
22-
2321
context "#{test.description}" do
24-
2522
if test.skip_test?(ADMIN_CLIENT)
2623
skip 'Test contains feature(s) not yet supported or version is not satisfied'
27-
2824
else
2925

3026
let(:client) do

0 commit comments

Comments
 (0)