Skip to content

Commit 6fde526

Browse files
committed
[API] Test Runner: Adds elastic-connectors filter to templates
Refactors in wipe_cluster_8
1 parent d453b07 commit 6fde526

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

api-spec-testing/wipe_cluster.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ def clear_templates_xpack(client)
177177
def xpack_template?(template)
178178
xpack_prefixes = [
179179
'.monitoring', '.watch', '.triggered-watches', '.data-frame', '.ml-', '.transform',
180-
'data-streams-mappings'
180+
'data-streams-mappings', 'elastic-connectors'
181181
].freeze
182-
xpack_prefixes.map { |a| return true if a.include? template }
182+
xpack_prefixes.map { |a| return true if (a.include?(template) || template.start_with?(a)) }
183183

184184
XPACK_TEMPLATES.include? template
185185
end

api-spec-testing/wipe_cluster_8.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ def wipe_all_templates(client)
242242
def platinum_template?(template)
243243
platinum_prefixes = [
244244
'.monitoring', '.watch', '.triggered-watches', '.data-frame', '.ml-', '.transform',
245-
'data-streams-mappings'
245+
'data-streams-mappings', 'elastic-connectors'
246246
].freeze
247-
platinum_prefixes.map { |a| return true if a.include? template }
247+
platinum_prefixes.map { |a| return true if (a.include?(template) || template.start_with?(a)) }
248248

249249
PLATINUM_TEMPLATES.include? template
250250
end
@@ -261,7 +261,7 @@ def wait_for_cluster_tasks(client)
261261
logger.debug "Pending cluster task: #{task}"
262262
count += 1
263263
end
264-
break unless count.positive? && Time.now.to_i < (time + 30)
264+
break unless count.positive? && Time.now.to_i < (time + 10)
265265
end
266266
end
267267

elasticsearch-api/spec/rest_yaml_tests_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
STACK_VERSION = ENV['STACK_VERSION']
2626
require 'elasticsearch/xpack'
2727

28+
def testing_compatibility?
29+
[1, true, 'true'].include?(ENV['ELASTIC_CLIENT_APIVERSIONING'])
30+
end
31+
2832
if (hosts = ELASTICSEARCH_URL)
2933
split_hosts = hosts.split(',').map do |host|
3034
/(http\:\/\/)?\S+/.match(host)

elasticsearch-xpack/spec/xpack/rest_api_yaml_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
context ctx do
4242
before(:all) do
4343
# Runs once before all tests in a test file
44-
if [true, 'true'].include?(ENV['ELASTIC_CLIENT_APIVERSIONING'])
44+
if testing_compatibility?
4545
Elasticsearch::RestAPIYAMLTests::WipeCluster8.run(ADMIN_CLIENT)
4646
else
4747
Elasticsearch::RestAPIYAMLTests::WipeCluster.run(ADMIN_CLIENT)
@@ -70,7 +70,7 @@
7070

7171
after(:all) do
7272
test_file.teardown
73-
if [true, 'true'].include?(ENV['ELASTIC_CLIENT_APIVERSIONING'])
73+
if testing_compatibility?
7474
Elasticsearch::RestAPIYAMLTests::WipeCluster8.run(ADMIN_CLIENT)
7575
else
7676
Elasticsearch::RestAPIYAMLTests::WipeCluster.run(ADMIN_CLIENT)

0 commit comments

Comments
 (0)