Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Nov 19, 2024
1 parent e9c38f0 commit d6f7406
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
30 changes: 11 additions & 19 deletions .buildkite/log-results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,19 @@ buildkite-agent artifact download "elasticsearch-api/tmp/*" .
files="elasticsearch-api/tmp/*.log"
for f in $files; do
RUBY_VERSION=`echo $f | grep -Po "(j?ruby-|\d+\.)+\d+" | tail -1`
buildkite-agent annotate --append "
:ruby: $RUBY_VERSION :test_tube:
"
TRANSPORT_VERSION=`echo $f | grep -Po "(transport-|\d+\.)+" | grep transport`
buildkite-agent annotate --append ":ruby: $RUBY_VERSION :phone: $TRANSPORT_VERSION :test_tube:\n"

FAILED_TESTS=`grep "E," $f`
if [[ -n "$FAILED_TESTS" ]]; then
buildkite-agent annotate --append "#### Failures in $f "
buildkite-agent annotate --append `grep "E," tmp/es-9.0.0-transport-8.3-jruby-9.4.8.0.log | awk -F '-- :' '{print $2}'`
fi

# Summary:
#
# We need the second part of the logs, so we use "-- :" as a field separator in awk
# I, [2024-11-19T09:54:00.190519 #342490] INFO -- : ⏲ Elapsed time: 00:01:31
#
buildkite-agent annotate --apend `awk -F "-- :" '{print $2}' $f`

# TODO: Failed tests:
FAILED_TESTS=`awk 'BEGIN { FS = " | "}; /\| failed \|/{ print $1 }' $f | uniq`
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
fi
buildkite-agent annotate --append `tail -2 $f | awk -F "-- :" '{print $2}'`
done
7 changes: 6 additions & 1 deletion elasticsearch-api/spec/yaml-test-runner/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@
end

tests_path = File.expand_path('./tmp', __dir__)
log_filename = "es-#{Elasticsearch::VERSION}-transport-#{ENV['TRANSPORT_VERSION']}-#{ENV['RUBY_SOURCE']}-#{ENV['RUBY_VERSION']}.log"
ruby_version = if defined? JRUBY_VERSION
"jruby-#{JRUBY_VERSION}"
else
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
Expand Down

0 comments on commit d6f7406

Please sign in to comment.