]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ci: call `finalize_test_case_output` a little later
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 21 May 2022 22:18:56 +0000 (22:18 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 21 May 2022 23:25:57 +0000 (16:25 -0700)
We used to call that function already before printing the final verdict.
However, now that we added grouping to the GitHub workflow output, we
will want to include even that part in the collapsible group for that
test case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh

index 29640d107cae6172af7c95f4fb8069b84ed939c0..9e410a5bb70c6655840b6cfd317d9e14f171890f 100644 (file)
@@ -783,13 +783,13 @@ trap '{ code=$?; set +x; } 2>/dev/null; exit $code' INT TERM HUP
 # the test_expect_* functions instead.
 
 test_ok_ () {
-       finalize_test_case_output ok "$@"
        test_success=$(($test_success + 1))
        say_color "" "ok $test_count - $@"
+       finalize_test_case_output ok "$@"
 }
 
 test_failure_ () {
-       finalize_test_case_output failure "$@"
+       failure_label=$1
        test_failure=$(($test_failure + 1))
        say_color error "not ok $test_count - $1"
        shift
@@ -799,18 +799,19 @@ test_failure_ () {
                say_color error "1..$test_count"
                _error_exit
        fi
+       finalize_test_case_output failure "$failure_label" "$@"
 }
 
 test_known_broken_ok_ () {
-       finalize_test_case_output fixed "$@"
        test_fixed=$(($test_fixed+1))
        say_color error "ok $test_count - $@ # TODO known breakage vanished"
+       finalize_test_case_output fixed "$@"
 }
 
 test_known_broken_failure_ () {
-       finalize_test_case_output broken "$@"
        test_broken=$(($test_broken+1))
        say_color warn "not ok $test_count - $@ # TODO known breakage"
+       finalize_test_case_output broken "$@"
 }
 
 test_debug () {
@@ -1136,10 +1137,10 @@ test_skip () {
 
        case "$to_skip" in
        t)
-               finalize_test_case_output skip "$@"
 
                say_color skip "ok $test_count # skip $1 ($skipped_reason)"
                : true
+               finalize_test_case_output skip "$@"
                ;;
        *)
                false