Skip to content

Commit 6efa650

Browse files
committed
YAML Tests: Download branch when in a release branch
1 parent 9631ac9 commit 6efa650

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ steps:
6868
env:
6969
RUBY_VERSION: "3.3"
7070
STACK_VERSION: 8.16.0-SNAPSHOT
71+
ES_YAML_TESTS_BRANCH: main
7172
TRANSPORT_VERSION: "8.3"
7273
RUBY_SOURCE: "ruby"
7374
TEST_SUITE: "platinum"

.buildkite/run-yaml-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ docker run \
3636
--env "BUILDKITE=true" \
3737
--env "TRANSPORT_VERSION=${TRANSPORT_VERSION}" \
3838
--env "STACK_VERSION=${STACK_VERSION}" \
39+
--env "ES_YAML_TESTS_BRANCH=${ES_YAML_TESTS_BRANCH}" \
3940
--volume $repo:/usr/src/app \
4041
--name elasticsearch-ruby \
4142
--rm \

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
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)