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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Jun 8, 2022 at 10:43 UTC
5aeb145780ffdfd516ad6fa697e7e14ba29be0bf
2 files changed
+18
-1
.github/workflows/main.yml
+16
@@ -119,6 +119,10 @@ jobs:
119
- name: test
120
shell: bash
121
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
126
- name: Upload failed tests' directories
127
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
128
uses: actions/upload-artifact@v2
@@ -200,6 +204,10 @@ jobs:
204
env:
205
NO_SVN_TESTS: 1
206
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
211
- name: Upload failed tests' directories
212
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
213
uses: actions/upload-artifact@v2
@@ -253,6 +261,10 @@ jobs:
261
- uses: actions/checkout@v2
262
- run: ci/install-dependencies.sh
263
- 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
268
- name: Upload failed tests' directories
269
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
270
uses: actions/upload-artifact@v2
@@ -282,6 +294,10 @@ jobs:
294
- uses: actions/checkout@v1
295
- run: ci/install-docker-dependencies.sh
296
- 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
301
- name: Upload failed tests' directories
302
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
303
uses: actions/upload-artifact@v1
ci/lib.sh
+2
-1
@@ -177,7 +177,8 @@ then
177
test_name="${test_exit%.exit}"
178
test_name="${test_name##*/}"
179
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."
182
cat "t/test-results/$test_name.markup"
183
184
trash_dir="t/trash directory.$test_name"