Skip to content

Commit 0dfaaed

Browse files
committed
[CI] Updates logging and script for buildkite summary
1 parent 0630fd1 commit 0dfaaed

File tree

3 files changed

+16
-24
lines changed

3 files changed

+16
-24
lines changed

.buildkite/log-results.sh

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,18 @@ buildkite-agent annotate --style info "## :rspec: Tests summary :rspec:
55
"
66
buildkite-agent artifact download "elasticsearch-api/tmp/*" .
77

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

21-
# Failed tests:
22-
files="elasticsearch-api/tmp/*.log"
23-
for f in $files; do
24-
FAILED_TESTS=`awk 'BEGIN { FS = " | "}; /\| failed \|/{ print $1 }' $f | uniq`
17+
FAILED_TESTS=`grep "E," $f`
2518
if [[ -n "$FAILED_TESTS" ]]; then
26-
buildkite-agent annotate --append "
27-
#### Failures in $f
28-
"
29-
FAILURES_ARRAY=($(echo $FAILED_TESTS | tr ' ' "\n"))
30-
for f in "${FAILURES_ARRAY[@]}"
31-
do
32-
buildkite-agent annotate --append "
33-
- $f
34-
"
35-
done
19+
buildkite-agent annotate --append "#### Failures in $f "
20+
buildkite-agent annotate --append `grep "E," $f | awk -F '-- :' '{print $2}'`
3621
fi
3722
done

.buildkite/run-yaml-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ docker run \
3737
--env "TRANSPORT_VERSION=${TRANSPORT_VERSION}" \
3838
--env "STACK_VERSION=${STACK_VERSION}" \
3939
--env "ES_YAML_TESTS_BRANCH=${ES_YAML_TESTS_BRANCH}" \
40+
--env "DEBUG=${DEBUG}" \
4041
--volume $repo:/usr/src/app \
4142
--name elasticsearch-ruby \
4243
--rm \

elasticsearch-api/spec/yaml-test-runner/run.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@
5656
end
5757

5858
tests_path = File.expand_path('./tmp', __dir__)
59-
logfile = File.expand_path "../../tmp/tests-#{Elasticsearch::VERSION}-transport-#{ENV['TRANSPORT_VERSION']}-ruby-#{ENV['RUBY_VERSION']}.log", __dir__
59+
ruby_version = if defined? JRUBY_VERSION
60+
"jruby-#{JRUBY_VERSION}"
61+
else
62+
"ruby-#{RUBY_VERSION}"
63+
end
64+
log_filename = "es-#{Elasticsearch::VERSION}-transport-#{ENV['TRANSPORT_VERSION']}-#{ruby_version}.log"
65+
logfile = File.expand_path "../../tmp/#{log_filename}", __dir__
6066
logger = Logger.new(File.open(logfile, 'w'))
6167
logger.level = ENV['DEBUG'] ? Logger::DEBUG : Logger::WARN
6268

0 commit comments

Comments
 (0)