From 55686252cdf6b2bf8799ca1f0c7d66380eaea9b9 Mon Sep 17 00:00:00 2001 From: Philip Hands Date: Fri, 27 Jan 2017 12:18:26 +0100 Subject: lvc: generally discard snapshots Keeping them results in subsequent runs doing nothing much, which is a little confusing. We should instead separate jobs that start from the snapshots, and then pass the snapshots between jobs when they succeed, as this should make later tests more resilient to when the early part is failing and would prevent the later tests from running. Signed-off-by: Holger Levsen --- bin/lvc.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/bin/lvc.sh b/bin/lvc.sh index f74ced03..310ef48f 100755 --- a/bin/lvc.sh +++ b/bin/lvc.sh @@ -142,24 +142,20 @@ else fetch_if_newer "$INITRD" "$URL/$INITRD" fi -# discard any snapshots that are older than the inputs -for dep in /srv/jenkins/cucumber /srv/jenkins/bin/lvc.sh /srv/jenkins/job-cfg/lvc.yaml $NETBOOT $PU_ISO ; do - if [ -e "$dep" ] ; then - LV_SNAP_DEPENDS="$LV_SNAP_DEPENDS $dep" - fi -done -discard_snapshots $LIBVIRT_DOMAIN_NAME $LV_SNAP_DEPENDS - -# --keep-snapshots -- keeps the VM snapshots -- let's make life simple and not do that until we're using them to pass on state to the next jenkins job +# discard any snapshots to ensure a clean run (we used to do this conditionally here, but that proved confusing) +discard_snapshots $LIBVIRT_DOMAIN_NAME echo "Debug log available at runtime at https://jenkins.debian.net/view/lvc/job/$JOB_NAME/ws/results/debug.log" /srv/jenkins/cucumber/bin/run_test_suite --capture-all --keep-snapshots --vnc-server-only --iso $IMAGE --tmpdir $WORKSPACE --old-iso $IMAGE -- --format pretty --format pretty_debug --out $RESULTS/debug.log /srv/jenkins/cucumber/features/step_definitions /srv/jenkins/cucumber/features/support "${@}" || { RETVAL=$? + # it may make sense to keep snapshots on failure, so subsequent tests are quicker -- only if we stop discarding them above though discard_snapshots $LIBVIRT_DOMAIN_NAME exit $RETVAL } +# FIXME -- decide here if we need to keep any snapshots, and put them somewhere safe for other jobs to find +discard_snapshots $LIBVIRT_DOMAIN_NAME cleanup_all # don't cleanup twice -- cgit v1.2.3-70-g09d2