diff --git a/hack/ci/logformatter b/hack/ci/logformatter index 4189ae9ff3..2356f634d6 100755 --- a/hack/ci/logformatter +++ b/hack/ci/logformatter @@ -317,6 +317,10 @@ END_HTML # BATS handling. This will recognize num_tests both at start and end if ($line =~ /^1\.\.(\d+)$/) { $looks_like_bats = 1; + # -1 is the "count unknown, expect it at the end" sentinel set + # below. It has to be replaced, not added to. + $bats_count{expected_total} = 0 + if ($bats_count{expected_total} // 0) < 0; $bats_count{expected_total} += $1; undef $looks_like_python; } diff --git a/hack/ci/logformatter.t b/hack/ci/logformatter.t index c43eac3039..597c3bfd66 100755 --- a/hack/ci/logformatter.t +++ b/hack/ci/logformatter.t @@ -483,3 +483,17 @@ ok 4 blah FAILED (failures=1, skipped=1) make: *** [Makefile:616: localapiv2] Error 1
Summary: 28 Passed, 1 Failed, 1 Skipped. Total tests: 30 (WARNING: expected 33) + +== bats plan line at end of run + +<<< +env PODMAN=./bin/podman stdbuf -o0 -e0 ./test/apiv2/test-apiv2 +ok 1 [00-TEMPLATE] check +not ok 2 [10-images] GET /images/json +1..2 +>>> +env PODMAN=./bin/podman stdbuf -o0 -e0 ./test/apiv2/test-apiv2 +ok 1 [00-TEMPLATE] check +not ok 2 [10-images] GET /images/json +1..2 +
Summary: 1 Passed, 1 Failed. Total tests: 2