From 1fac61ef57552f49c27eaf95ccbb49440dfa77c6 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Mon, 16 Jan 2023 11:39:04 -0500 Subject: [PATCH] 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 --- contrib/cirrus/runner.sh | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/contrib/cirrus/runner.sh b/contrib/cirrus/runner.sh index 74a05ed0..3792a249 100755 --- a/contrib/cirrus/runner.sh +++ b/contrib/cirrus/runner.sh @@ -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" }