File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
#
3
3
# This script is intended to be run after the build in a Buildkite pipeline
4
- buildkite-agent annotate " ## :rspec: Tests summary :rspec:
4
+ buildkite-agent annotate --style info " ## :rspec: Tests summary :rspec:
5
5
"
6
- buildkite-agent artifact download " elasticsearch-api/tmp/*.html " .
6
+ buildkite-agent artifact download " elasticsearch-api/tmp/*" .
7
7
8
+ # Test result summary:
8
9
files=" elasticsearch-api/tmp/*.html"
9
10
for f in $files ; do
10
11
TEST_SUITE=` echo $f | grep -o " \(free\|platinum\)" `
11
12
RUBY_VERSION=` echo $f | grep -Po " (\d+\.)+\d+" `
12
13
EXAMPLES=` cat $f | grep -o " [0-9]\+ examples\?" | tail -1`
13
14
FAILURES=` cat $f | grep -o " [0-9]\+ failures\?" | tail -1`
14
15
PENDING=` cat $f | grep -o " [0-9]\+ pending" | tail -1`
15
- buildkite-agent annotate --style info -- append "
16
+ buildkite-agent annotate --append "
16
17
:ruby: $RUBY_VERSION :test_tube: $TEST_SUITE :rspec: $EXAMPLES - :x: $FAILURES - :suspect: $PENDING
17
18
"
18
19
done
20
+
21
+ # Get file names for failing tests
22
+ # FAILED_TESTS=`awk 'BEGIN { FS = " | "}; /\| failed \|/{ print $1 }' 'elasticsearch-api/tmp/rspec_log.log' | uniq`
23
+
24
+ files=" elasticsearch-api/tmp/*.log"
25
+ for f in $files ; do
26
+ FAILED_TESTS=` awk ' BEGIN { FS = " | "}; /\| failed \|/{ print $1 }' $f | uniq`
27
+ if [[ -n " $FAILED_TESTS " ]]; then
28
+ buildkite-agent annotate --append "
29
+ #### Failures in $f
30
+ "
31
+ for f in " ${FAILED_TESTS[@]} "
32
+ do
33
+ buildkite-agent annotate --append "
34
+ $f
35
+ "
36
+ done
37
+ fi
38
+ done
You can’t perform that action at this time.
0 commit comments