Skip to content

Commit

Permalink
ci: call finalize_test_case_output a little later
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dscho authored and gitster committed Feb 26, 2022
1 parent 3c9cb6d commit 054ce81
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -734,30 +734,31 @@ 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
printf '%s\n' "$*" | sed -e 's/^/# /'
test "$immediate" = "" || _error_exit
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 () {
Expand Down Expand Up @@ -1083,10 +1084,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
Expand Down

0 comments on commit 054ce81

Please sign in to comment.