mirror of
https://github.com/containers/podman.git
synced 2025-05-17 15:18:43 +08:00
system test parallelization: enable two-pass approach
For the past two months we've been splitting system tests into two categories: those that CAN be run in parallel, and those that CANNOT. Much work has been done to replace hardcoded names (mycontainer, mypod) with safename(). Hundreds of test runs, in CI and on Ed's laptop, have proven this approach viable. make {local,remote}system now runs in two steps: first the serial ones, then the parallel ones. hack/bats will now recognize the 'ci:parallel' tag and add --jobs (nprocs). This requires some tweaking of leak_check, because there can be umpteen tests running (affecting image/container/pod/etc state) when any given test completes. Rules for enabling parallelization in tests: * use unique container/pod/volume/network names (safename) * do not run 'podman rm -a' or 'rmi -a' * never use the -l (--latest) option * do not run 'podman ps/images' and expect precise output Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
6
Makefile
6
Makefile
@ -688,7 +688,8 @@ localmachine:
|
||||
localsystem:
|
||||
# Wipe existing config, database, and cache: start with clean slate.
|
||||
$(RM) -rf ${HOME}/.local/share/containers ${HOME}/.config/containers
|
||||
if timeout -v 1 true; then PODMAN=$(CURDIR)/bin/podman QUADLET=$(CURDIR)/bin/quadlet bats -T test/system/; else echo "Skipping $@: 'timeout -v' unavailable'"; fi
|
||||
PODMAN=$(CURDIR)/bin/podman QUADLET=$(CURDIR)/bin/quadlet bats -T --filter-tags '!ci:parallel' test/system/
|
||||
PODMAN=$(CURDIR)/bin/podman QUADLET=$(CURDIR)/bin/quadlet bats -T --filter-tags ci:parallel -j $$(nproc) test/system/
|
||||
|
||||
.PHONY: remotesystem
|
||||
remotesystem:
|
||||
@ -717,7 +718,8 @@ remotesystem:
|
||||
echo "Error: ./bin/podman system service did not come up" >&2;\
|
||||
exit 1;\
|
||||
fi;\
|
||||
env PODMAN="$(CURDIR)/bin/podman-remote" bats -T test/system/ ;\
|
||||
env PODMAN="$(CURDIR)/bin/podman-remote" bats -T --filter-tags '!ci:parallel' test/system/ ;\
|
||||
env PODMAN="$(CURDIR)/bin/podman-remote" bats -T --filter-tags ci:parallel -j $$(nproc) test/system/ ;\
|
||||
rc=$$?;\
|
||||
kill %1;\
|
||||
else \
|
||||
|
Reference in New Issue
Block a user