File tree Expand file tree Collapse file tree 6 files changed +29
-32
lines changed Expand file tree Collapse file tree 6 files changed +29
-32
lines changed Original file line number Diff line number Diff line change 66 branches :
77 - develop
88 - master
9- - slegrand-actions-debug
109
1110 pull_request :
1211 branches :
7372
7473 - name : Check
7574 run : |
76- make check
77- echo "Tests failed: " $(grep :test-result examples/*/*.trs | grep FAIL | wc -l)
75+ make check -i
7876 ./etc/actions/failed_tests_logs.sh
7977
8078 - name : Install
@@ -150,8 +148,7 @@ jobs:
150148
151149 - name : Check
152150 run : |
153- make check
154- echo "Tests failed: " $(grep :test-result examples/*/*.trs | grep FAIL | wc -l)
151+ make check -i
155152 ./etc/actions/failed_tests_logs.sh
156153
157154 - name : Install
Original file line number Diff line number Diff line change 66 branches :
77 - develop
88 - master
9- - slegrand-actions-debug
109
1110 pull_request :
1211 branches :
@@ -106,6 +105,5 @@ jobs:
106105
107106 - name : Check
108107 run : |
109- make check
110- echo "Tests failed: " $(grep :test-result examples/*/*.trs | grep FAIL | wc -l)
108+ make check -i
111109 ./etc/actions/failed_tests_logs.sh
Original file line number Diff line number Diff line change 66 branches :
77 - develop
88 - master
9- - slegrand-actions-debug
109
1110 pull_request :
1211 branches :
7372
7473 - name : Check
7574 run : |
76- make check
77- echo "Tests failed: " $(grep :test-result examples/*/*.trs | grep FAIL | wc -l)
75+ make check -i
7876 ./etc/actions/failed_tests_logs.sh
7977
8078 - name : Install
Original file line number Diff line number Diff line change 55 branches :
66 - develop
77 - master
8- - slegrand-actions-debug
98
109 pull_request :
1110 branches :
4948
5049 - name : Check
5150 run : |
52- make check
53- echo "Tests failed: " $(grep :test-result examples/*/*.trs | grep FAIL | wc -l)
51+ make check -i
5452 ./etc/actions/failed_tests_logs.sh
5553
5654 - name : Install
8886
8987 - name : Check
9088 run : |
91- make check
92- echo "Tests failed: " $(grep :test-result examples/*/*.trs | grep FAIL | wc -l)
89+ make check -i
9390 ./etc/actions/failed_tests_logs.sh
9491
9592 - name : Install
@@ -139,6 +136,5 @@ jobs:
139136
140137 - name : Check
141138 run : |
142- make check
143- echo "Tests failed: " $(grep :test-result examples/*/*.trs | grep FAIL | wc -l)
139+ make check -i
144140 ./etc/actions/failed_tests_logs.sh
Original file line number Diff line number Diff line change 55 branches :
66 - develop
77 - master
8- - slegrand-actions-debug
98
109 pull_request :
1110 branches :
5150
5251 - name : Check
5352 run : |
54- make check
55- echo "Tests failed: " $(grep :test-result examples/*/*.trs | grep FAIL | wc -l)
53+ make check -i
5654 ./etc/actions/failed_tests_logs.sh
5755
5856 - name : Install
8987
9088 - name : Check
9189 run : |
92- make check
93- echo "Tests failed: " $(grep :test-result examples/*/*.trs | grep FAIL | wc -l)
90+ make check -i
9491 ./etc/actions/failed_tests_logs.sh
9592
9693 - name : Install
@@ -146,6 +143,5 @@ jobs:
146143
147144 - name : Check
148145 run : |
149- make check
150- echo "Tests failed: " $(grep :test-result examples/*/*.trs | grep FAIL | wc -l)
146+ make check -i
151147 ./etc/actions/failed_tests_logs.sh
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- FAILED_TESTS=( $( grep :test-result examples/* /* .trs | grep FAIL) )
3+ # This script checks if tests have failed. If yes, it prints the content of the
4+ # failed tests log, and returns 1.
5+ #
6+ # It allows keeping the '-i' option for 'make check', print the failed
7+ # tests, and only then, return exit 1 to interrupt the CI pipeline.
48
5- for val in ${FAILED_TESTS[@]/#* FAIL/ }
6- do
7- IFS=" ::"
8- read -ra path <<< $val
9+ FAILED_TESTS=$( grep " :test-result: FAIL" examples/* /* .trs)
10+
11+ if [ -z " $FAILED_TESTS " ]; then
12+ exit 0;
13+ fi
14+
15+ NB_FAILED_TESTS=$( echo " $FAILED_TESTS " | wc -l)
16+ echo " $NB_FAILED_TESTS tests failed:"
17+
18+ echo " $FAILED_TESTS " | while IFS= read -r line; do
19+ path=" ${line%:: test-result: FAIL} "
920 printf " \n******** ${path% .* } .log ********\n\n"
1021 tail -n 100 ${path% .* } .log
11- unset IFS
12- done ;
22+ done
23+
24+ exit 1
You can’t perform that action at this time.
0 commit comments