Skip to content
Merged
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
31 changes: 8 additions & 23 deletions .buildkite/log-results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,18 @@ buildkite-agent annotate --style info "## :rspec: Tests summary :rspec:
"
buildkite-agent artifact download "elasticsearch-api/tmp/*" .

# Test result summary:
files="elasticsearch-api/tmp/*.html"
files="elasticsearch-api/tmp/*.log"
for f in $files; do
TEST_SUITE=`echo $f | grep -o "\(free\|platinum\)"`
RUBY_VERSION=`echo $f | grep -Po "(jruby-|\d+\.)+\d+"`
EXAMPLES=`cat $f | grep -o "[0-9]\+ examples\?" | tail -1`
FAILURES=`cat $f | grep -o "[0-9]\+ failures\?" | tail -1`
PENDING=`cat $f | grep -o "[0-9]\+ pending" | tail -1`
RUBY_VERSION=`echo $f | grep -Po "(j?ruby-|\d+\.)+\d+" | tail -1`
TRANSPORT_VERSION=`echo $f | grep -Po "transport-([\d.]+|main)"`
buildkite-agent annotate --append "
:ruby: $RUBY_VERSION :test_tube: $TEST_SUITE :rspec: $EXAMPLES - :x: $FAILURES - :suspect: $PENDING
:ruby: $RUBY_VERSION :phone: $TRANSPORT_VERSION `tail --lines=2 $f | awk -F "-- :" '{print $2}'`

"
done

# Failed tests:
files="elasticsearch-api/tmp/*.log"
for f in $files; do
FAILED_TESTS=`awk 'BEGIN { FS = " | "}; /\| failed \|/{ print $1 }' $f | uniq`
FAILED_TESTS=`grep "E," $f`
if [[ -n "$FAILED_TESTS" ]]; then
buildkite-agent annotate --append "
#### Failures in $f
"
FAILURES_ARRAY=($(echo $FAILED_TESTS | tr ' ' "\n"))
for f in "${FAILURES_ARRAY[@]}"
do
buildkite-agent annotate --append "
- $f
"
done
buildkite-agent annotate --append "#### Failures in $f "
buildkite-agent annotate --append `grep "E," $f | awk -F '-- :' '{print $2}'`
fi
done
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
1 change: 1 addition & 0 deletions .buildkite/run-yaml-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ docker run \
--env "TRANSPORT_VERSION=${TRANSPORT_VERSION}" \
--env "STACK_VERSION=${STACK_VERSION}" \
--env "ES_YAML_TESTS_BRANCH=${ES_YAML_TESTS_BRANCH}" \
--env "DEBUG=${DEBUG}" \
--volume $repo:/usr/src/app \
--name elasticsearch-ruby \
--rm \
Expand Down
14 changes: 10 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,18 @@
end

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

logger = Logger.new($stdout)
logger.level = Logger::WARN unless ENV['DEBUG']
ruby_version = if defined? JRUBY_VERSION
"jruby-#{JRUBY_VERSION}"
else
"ruby-#{RUBY_VERSION}"
end
log_filename = "es-#{Elasticsearch::VERSION}-transport-#{ENV['TRANSPORT_VERSION']}-#{ruby_version}.log"
logfile = File.expand_path "../../tmp/#{log_filename}", __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'] || [])