Skip to content

Commit 6cfe81f

Browse files
committed
YAML Tests: Download branch when in a release branch
1 parent d37bf31 commit 6cfe81f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ steps:
6767
env:
6868
RUBY_VERSION: "3.3"
6969
STACK_VERSION: 8.15.0-SNAPSHOT
70+
ES_YAML_TESTS_BRANCH: 8.15
7071
TRANSPORT_VERSION: "8.3"
7172
RUBY_SOURCE: "ruby"
7273
TEST_SUITE: "platinum"

elasticsearch-api/spec/yaml-test-runner/run.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@
5555
CLIENT = Elasticsearch::Client.new(host: host, transport_options: transport_options)
5656
end
5757

58-
5958
tests_path = File.expand_path('./tmp', __dir__)
6059

6160
logger = Logger.new($stdout)
6261
logger.level = Logger::WARN unless ENV['DEBUG']
6362

64-
Elasticsearch::Tests::Downloader::run(tests_path)
63+
# If we're running in a release branch, download the corresponding branch for tests
64+
current_branch = `git rev-parse --abbrev-ref HEAD`.strip
65+
branch = current_branch.match(/[0-9]\.[0-9]+/)[0] || ENV['ES_YAML_TESTS_BRANCH'] || nil
66+
Elasticsearch::Tests::Downloader::run(tests_path, branch)
6567
Elasticsearch::Tests::TestRunner.new(CLIENT, tests_path, logger).run

0 commit comments

Comments
 (0)