Skip to content

Commit facae84

Browse files
committed
[CI] Updates log results
1 parent a97062b commit facae84

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

.buildkite/log-results.sh

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
#!/usr/bin/env bash
22
#
33
# This script is intended to be run after the build in a Buildkite pipeline
4-
echo "--- Test summary"
5-
buildkite-agent artifact download "elasticsearch-api/tmp/*.html" .
4+
buildkite-agent annotate --style info "## :rspec: Tests summary :rspec:
5+
"
6+
buildkite-agent artifact download "elasticsearch-api/tmp/*" .
67

8+
# Test result summary:
79
files="elasticsearch-api/tmp/*.html"
810
for f in $files; do
911
TEST_SUITE=`echo $f | grep -o "\(free\|platinum\)"`
10-
RUBY_VERSION=`echo $f | grep -Po "(\d+\.)+\d+" | head -1`
11-
STACK_VERSION=`echo $f | grep -Po "([0-9.]+(-SNAPSHOT))"`
12-
EXAMPLES=`cat $f | grep -o "[0-9]\+ examples" | tail -1`
13-
FAILURES=`cat $f | grep -o "[0-9]\+ failures" | tail -1`
12+
RUBY_VERSION=`echo $f | grep -Po "(\d+\.)+\d+"`
13+
EXAMPLES=`cat $f | grep -o "[0-9]\+ examples\?" | tail -1`
14+
FAILURES=`cat $f | grep -o "[0-9]\+ failures\?" | tail -1`
1415
PENDING=`cat $f | grep -o "[0-9]\+ pending" | tail -1`
15-
echo "--- :elasticsearch: $STACK_VERSION :ruby: $RUBY_VERSION :test_tube: $TEST_SUITE :rspec: $EXAMPLES - :x: $FAILURES - :pinched_fingers: $PENDING"
16+
buildkite-agent annotate --append "
17+
:ruby: $RUBY_VERSION :test_tube: $TEST_SUITE :rspec: $EXAMPLES - :x: $FAILURES - :suspect: $PENDING
18+
"
19+
done
20+
21+
files="elasticsearch-api/tmp/*.log"
22+
for f in $files; do
23+
FAILED_TESTS=`awk 'BEGIN { FS = " | "}; /\| failed \|/{ print $1 }' $f | uniq`
24+
if [[ -n "$FAILED_TESTS" ]]; then
25+
buildkite-agent annotate --append "
26+
#### Failures in $f
27+
"
28+
FAILURES_ARRAY=($(echo $FAILED_TESTS | tr ' ' "\n"))
29+
for f in "${FAILURES_ARRAY[@]}"
30+
do
31+
buildkite-agent annotate --append "
32+
- $f
33+
"
34+
done
35+
fi
1636
done

0 commit comments

Comments
 (0)