Skip to content

Commit 5aeb145

Browse files
dschogitster
authored andcommitted
ci(github): bring back the 'print test failures' step
Git now shows better information in the GitHub workflow runs when a test case failed. However, when a test case was implemented incorrectly and therefore does not even run, nothing is shown. Let's bring back the step that prints the full logs of the failed tests, and to improve the user experience, print out an informational message for readers so that they do not have to know/remember where to see the full logs. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3069f2a commit 5aeb145

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ jobs:
119119
- name: test
120120
shell: bash
121121
run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10
122+
- name: print test failures
123+
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
124+
shell: bash
125+
run: ci/print-test-failures.sh
122126
- name: Upload failed tests' directories
123127
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
124128
uses: actions/upload-artifact@v2
@@ -200,6 +204,10 @@ jobs:
200204
env:
201205
NO_SVN_TESTS: 1
202206
run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10
207+
- name: print test failures
208+
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
209+
shell: bash
210+
run: ci/print-test-failures.sh
203211
- name: Upload failed tests' directories
204212
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
205213
uses: actions/upload-artifact@v2
@@ -253,6 +261,10 @@ jobs:
253261
- uses: actions/checkout@v2
254262
- run: ci/install-dependencies.sh
255263
- run: ci/run-build-and-tests.sh
264+
- name: print test failures
265+
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
266+
shell: bash
267+
run: ci/print-test-failures.sh
256268
- name: Upload failed tests' directories
257269
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
258270
uses: actions/upload-artifact@v2
@@ -282,6 +294,10 @@ jobs:
282294
- uses: actions/checkout@v1
283295
- run: ci/install-docker-dependencies.sh
284296
- run: ci/run-build-and-tests.sh
297+
- name: print test failures
298+
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
299+
shell: bash
300+
run: ci/print-test-failures.sh
285301
- name: Upload failed tests' directories
286302
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
287303
uses: actions/upload-artifact@v1

ci/lib.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ then
177177
test_name="${test_exit%.exit}"
178178
test_name="${test_name##*/}"
179179
printf "\\e[33m\\e[1m=== Failed test: ${test_name} ===\\e[m\\n"
180-
echo "The full logs are in the artifacts attached to this run."
180+
echo "The full logs are in the 'print test failures' step below."
181+
echo "See also the 'failed-tests-*' artifacts attached to this run."
181182
cat "t/test-results/$test_name.markup"
182183

183184
trash_dir="t/trash directory.$test_name"

0 commit comments

Comments
 (0)