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 9c068dd
Show file tree
Hide file tree
Showing 3 changed files with 6 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
1 change: 1 addition & 0 deletions .buildkite/run-yaml-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ docker run \
--env "BUILDKITE=true" \
--env "TRANSPORT_VERSION=${TRANSPORT_VERSION}" \
--env "STACK_VERSION=${STACK_VERSION}" \
--env "ES_YAML_TESTS_BRANCH=${ES_YAML_TESTS_BRANCH}" \
--volume $repo:/usr/src/app \
--name elasticsearch-ruby \
--rm \
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 9c068dd

Please sign in to comment.