Skip to content

Commit

Permalink
YAML Tests: Download branch when in a release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Sep 2, 2024
1 parent d37bf31 commit 6cfe81f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ steps:
env:
RUBY_VERSION: "3.3"
STACK_VERSION: 8.15.0-SNAPSHOT
ES_YAML_TESTS_BRANCH: 8.15
TRANSPORT_VERSION: "8.3"
RUBY_SOURCE: "ruby"
TEST_SUITE: "platinum"
Expand Down
6 changes: 4 additions & 2 deletions elasticsearch-api/spec/yaml-test-runner/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@
CLIENT = Elasticsearch::Client.new(host: host, transport_options: transport_options)
end


tests_path = File.expand_path('./tmp', __dir__)

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

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

0 comments on commit 6cfe81f

Please sign in to comment.