Unverified Commit 561ec056 authored by Derek Nola's avatar Derek Nola Committed by GitHub

Drone: Cleanup E2E VMs on test panic (#7104)

* Cleanup leftover VMs in E2E pipeline Signed-off-by: 's avatarDerek Nola <derek.nola@suse.com>
parent 99805041
......@@ -665,6 +665,22 @@ platform:
arch: amd64
steps:
- name: skipfiles
image: plugins/git
commands:
- export NAME=$(test $DRONE_BUILD_EVENT = pull_request && echo remotes/origin/${DRONE_COMMIT_BRANCH:-master} || echo ${DRONE_COMMIT_SHA}~)
- export DIFF=$(git --no-pager diff --name-only $NAME | grep -v -f .droneignore);
- if [ -z "$DIFF" ]; then
echo "All files in PR are on ignore list";
exit 78;
else
echo "Some files in PR are not ignored, $DIFF";
fi;
when:
event:
- push
- pull_request
- name: build-e2e-image
image: rancher/dapper:v0.5.0
commands:
......@@ -692,13 +708,22 @@ steps:
- docker run -d -p 5000:5000 -e REGISTRY_PROXY_REMOTEURL=https://registry-1.docker.io --name registry registry:2
- cd tests/e2e/validatecluster
- vagrant destroy -f
- go test -v -timeout=30m ./validatecluster_test.go -ci -local
- go test -v -timeout=45m ./validatecluster_test.go -ci -local
- cd ../secretsencryption
- vagrant destroy -f
- go test -v -timeout=30m ./secretsencryption_test.go -ci -local
- cd ../upgradecluster
- E2E_RELEASE_CHANNEL="latest" go test -v -timeout=45m ./upgradecluster_test.go -ci -local
- docker stop registry && docker rm registry
# Cleanup any VMs still running, happens if a test panics
- VMS=$(virsh list --name | grep '_server-\|_agent-' || true)
- |
for vm in $VMS
do
virsh destroy $vm
virsh undefine $vm --remove-all-storage
done
volumes:
- name: libvirt
path: /var/run/libvirt/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment