Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Log test results to a file in Buildkite #2513

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ steps:
TRANSPORT_VERSION: "{{ matrix.transport }}"
RUBY_SOURCE: "{{ matrix.ruby_source }}"
TEST_SUITE: "platinum"
DEBUG: true
command: ./.buildkite/run-yaml-tests.sh
artifact_paths: "elasticsearch-api/tmp/*"
- wait: ~
continue_on_failure: true
- label: "Log Results"
Expand Down
8 changes: 4 additions & 4 deletions elasticsearch-api/spec/yaml-test-runner/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
end

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

logger = Logger.new($stdout)
logger.level = Logger::WARN unless ENV['DEBUG']
logfile = File.expand_path "../../tmp/tests-#{Elasticsearch::VERSION}-transport-#{ENV['TRANSPORT_VERSION']}-ruby-#{ENV['RUBY_VERSION']}.log", __dir__
logger = Logger.new(File.open(logfile, 'w'))
logger.level = ENV['DEBUG'] ? Logger::DEBUG : Logger::WARN

# 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
Elasticsearch::Tests::TestRunner.new(CLIENT, tests_path, logger).run(ENV['SINGLE_TEST'] || [])