Skip to content

Commit 00ecdac

Browse files
committed
[API] compatibility tests: Run from compatTest folder
1 parent 1159fe8 commit 00ecdac

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

elasticsearch-api/spec/rest_yaml_tests_helper.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
TRANSPORT_OPTIONS = {}
2424
PROJECT_PATH = File.join(File.dirname(__FILE__), '..')
25+
STACK_VERSION = ENV['STACK_VERSION']
2526

2627
if (hosts = ELASTICSEARCH_URL)
2728
split_hosts = hosts.split(',').map do |host|
@@ -37,7 +38,7 @@
3738
if defined?(TEST_HOST) && defined?(TEST_PORT)
3839
URL = "http://#{TEST_HOST}:#{TEST_PORT}"
3940

40-
if ENV['STACK_VERSION'] == '8.0.0-SNAPSHOT'
41+
if STACK_VERSION.match?(/^8\./)
4142
user = 'elastic'.freeze
4243
password = 'changeme'.freeze
4344
ADMIN_CLIENT = Elasticsearch::Client.new(
@@ -76,7 +77,7 @@
7677
end
7778
end
7879

79-
YAML_FILES_DIRECTORY = "#{PROJECT_PATH}/../tmp/rest-api-spec/test/free"
80+
YAML_FILES_DIRECTORY = "#{PROJECT_PATH}/../tmp/rest-api-spec/#{STACK_VERSION.match?(/^8\./) ? 'compatTest' : 'test'}/free"
8081

8182
SINGLE_TEST = if ENV['SINGLE_TEST'] && !ENV['SINGLE_TEST'].empty?
8283
test_target = ENV['SINGLE_TEST']

elasticsearch-xpack/spec/rest_yaml_tests_helper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
TRANSPORT_OPTIONS = {}
2525
TEST_SUITE = ENV['TEST_SUITE'].freeze || 'platinum'
26+
STACK_VERSION = ENV['STACK_VERSION']
2627

2728
if hosts = ENV['TEST_ES_SERVER'] || ENV['ELASTICSEARCH_HOSTS']
2829
split_hosts = hosts.split(',').map do |host|
@@ -65,7 +66,7 @@
6566
end
6667
end
6768

68-
YAML_FILES_DIRECTORY = "#{PROJECT_PATH}/tmp/rest-api-spec/test/platinum"
69+
YAML_FILES_DIRECTORY = "#{PROJECT_PATH}/tmp/rest-api-spec/#{STACK_VERSION.match?(/^8\./) ? 'compatTest' : 'test'}/platinum"
6970

7071
SINGLE_TEST = if ENV['SINGLE_TEST'] && !ENV['SINGLE_TEST'].empty?
7172
test_target = ENV['SINGLE_TEST']

0 commit comments

Comments
 (0)