mirror of
https://github.com/containers/podman.git
synced 2025-12-03 19:59:39 +08:00
bats log: differentiate parallel tests from sequential
For tests run in parallel, show file number as |nnn| (vs [nnn]) Teach logformatter to distinguish the two, adding 'p' to anchors in parallel tests. Necessary because in this scheme we run bats twice, thus see 'ok 1' twice, and we want to differentiate them. Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
@@ -160,7 +160,12 @@ function basic_setup() {
|
||||
|
||||
# Test filenames must match ###-name.bats; use "[###] " as prefix
|
||||
run expr "$BATS_TEST_FILENAME" : "^.*/\([0-9]\{3\}\)-[^/]\+\.bats\$"
|
||||
BATS_TEST_NAME_PREFIX="[${output}] "
|
||||
# If parallel, use |nnn|. Serial, [nnn]
|
||||
if [[ -n "$PARALLEL_JOBSLOT" ]]; then
|
||||
BATS_TEST_NAME_PREFIX="|${output}| "
|
||||
else
|
||||
BATS_TEST_NAME_PREFIX="[${output}] "
|
||||
fi
|
||||
|
||||
# By default, assert() and die() cause an immediate test failure.
|
||||
# Under special circumstances (usually long test loops), tests
|
||||
|
||||
Reference in New Issue
Block a user