Skip to content

Commit b95181c

Browse files
dschogitster
authored andcommitted
ci/run-build-and-tests: take a more high-level view
In the web UI of GitHub workflows, failed runs are presented with the job step that failed auto-expanded. In the current setup, this is not helpful at all because that shows only the output of `prove`, which says which test failed, but not in what way. What would help understand the reader what went wrong is the verbose test output of the failed test. The logs of the failed runs do contain that verbose test output, but it is shown in the _next_ step (which is marked as succeeding, and is therefore _not_ auto-expanded). Anyone not intimately familiar with this would completely miss the verbose test output, being left mostly puzzled with the test failures. We are about to show the failed test cases' output in the _same_ step, so that the user has a much easier time to figure out what was going wrong. But first, we must partially revert the change that tried to improve the CI runs by combining the `Makefile` targets to build into a single `make` invocation. That might have sounded like a good idea at the time, but it does make it rather impossible for the CI script to determine whether the _build_ failed, or the _tests_. If the tests were run at all, that is. So let's go back to calling `make` for the build, and call `make test` separately so that we can easily detect that _that_ invocation failed, and react appropriately. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 270ccd2 commit b95181c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ci/run-build-and-tests.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ windows*) cmd //c mklink //j t\\.prove "$(cygpath -aw "$cache_dir/.prove")";;
1010
*) ln -s "$cache_dir/.prove" t/.prove;;
1111
esac
1212

13-
export MAKE_TARGETS="all test"
13+
run_tests=t
1414

1515
case "$jobname" in
1616
linux-gcc)
@@ -41,14 +41,15 @@ pedantic)
4141
# Don't run the tests; we only care about whether Git can be
4242
# built.
4343
export DEVOPTS=pedantic
44-
export MAKE_TARGETS=all
44+
run_tests=
4545
;;
4646
esac
4747

48-
# Any new "test" targets should not go after this "make", but should
49-
# adjust $MAKE_TARGETS. Otherwise compilation-only targets above will
50-
# start running tests.
51-
make $MAKE_TARGETS
48+
make
49+
if test -n "$run_tests"
50+
then
51+
make test
52+
fi
5253
check_unignored_build_artifacts
5354

5455
save_good_tree

0 commit comments

Comments
 (0)