Cirrus: Add a common intra-test reset function

This is necessary, since running the skopeo tests modifies the host
environment.  This can result in some warning messages the first time
a container is started.  These messages can interfere with tests which
are sensitive to stdout/stderr.  Since many/most tests require a local
image registry, launch it with `/bin/true` after doing a system reset
to clear away any pesky warning messages.

Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
Chris Evich 2023-01-16 11:39:04 -05:00
parent 292962d34c
commit 1fac61ef57
No known key found for this signature in database
GPG Key ID: 03EDC70FD578067F

View File

@ -112,18 +112,32 @@ _run_unit() {
make test-unit-local BUILDTAGS="$BUILDTAGS"
}
_run_integration() {
_podman_reset() {
# Ensure we start with a clean-slate
podman system reset --force
showrun podman system reset --force
# Don't pollute the CI environment
(
source $CIRRUS_WORKING_DIR/systemtest/helpers.bash
# WARNING WARNING WARNING WARNING
# Without running a container, the system tests will inexplicably
# fail with obscure errors/warning messages. I have no idea why
# running a container after a `system reset` fixes/prevents the
# problem. The failures do not reproduce when tests are run manually.
# So unless or until /until somebody develops a better understanding,
# this fix is JFM.
# WARNING WARNING WARNING WARNING
showrun podman run -it --rm --entrypoint /bin/true $REGISTRY_FQIN
)
}
_run_integration() {
_podman_reset
make test-integration-local BUILDTAGS="$BUILDTAGS"
}
_run_system() {
# Ensure we start with a clean-slate
podman system reset --force
# Executes with containers required for testing.
_podman_reset
##### Note: Test MODIFIES THE HOST SETUP #####
make test-system-local BUILDTAGS="$BUILDTAGS"
}