mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Drone: Cleanup E2E VMs on test panic (#7104)
* Cleanup leftover VMs in E2E pipeline Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
parent
9980504196
commit
561ec056c1
27
.drone.yml
27
.drone.yml
@ -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/
|
||||
|
Loading…
Reference in New Issue
Block a user