Skip to content

Commit

Permalink
Move back to 2 groups, reduce VM life to 1h
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <[email protected]>
  • Loading branch information
dereknola committed Dec 11, 2024
1 parent 7b6d7d4 commit 383d84a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 44 deletions.
56 changes: 14 additions & 42 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -605,24 +605,23 @@ steps:
path: /var/run/docker.sock

# For better parallelism, we run the E2E tests in a chunked directed acyclic graph
# First we cleanup any VMs that are older than 2h. Then, tests are split into 3 groups:
# - validatecluster and upgradecluster
# - secretsencryption and snapshotrestore
# - splitserver and token
# First we cleanup any VMs that are older than 1h. Then, tests are split into 2 groups:
# - validatecluster, token, and upgradecluster
# - secretsencryption and splitserver

- name: cleanup-vms
image: test-e2e
pull: never
depends_on:
- build-e2e-image
commands:
# Cleanup VMs that are older than 2h. Happens if a previous test panics or is canceled
# Cleanup VMs that are older than 1h. Happens if a previous test panics or is canceled
- tests/e2e/scripts/cleanup_vms.sh
volumes:
- name: libvirt
path: /var/run/libvirt/

- name: test-e2e-block1
- name: test-block1
image: test-e2e
depends_on:
- cleanup-vms
Expand All @@ -643,6 +642,11 @@ steps:
vagrant destroy -f
go test -v -timeout=45m ./validatecluster_test.go -ci -local
cp ./coverage.out /tmp/artifacts/validate-coverage.out
- |
cd ../token
vagrant destroy -f
go test -v -timeout=30m ./token_test.go -ci -local
cp ./coverage.out /tmp/artifacts/token-coverage.out
- |
if [ "$DRONE_BUILD_EVENT" = "pull_request" ]; then
cd ../upgradecluster
Expand Down Expand Up @@ -671,7 +675,7 @@ steps:
- name: cache
path: /tmp/artifacts

- name: test-e2e-block2
- name: test-block2
image: test-e2e
depends_on:
- cleanup-vms
Expand All @@ -689,42 +693,12 @@ steps:
vagrant destroy -f
go test -v -timeout=30m ./secretsencryption_test.go -ci -local
cp ./coverage.out /tmp/artifacts/se-coverage.out
- |
cd ../snapshotrestore
vagrant destroy -f
go test -v -timeout=30m ./snapshotrestore_test.go -ci -local
cp ./coverage.out /tmp/artifacts/snap-coverage.out
volumes:
- name: libvirt
path: /var/run/libvirt/
- name: cache
path: /tmp/artifacts

- name: test-e2e-block3
image: test-e2e
depends_on:
- cleanup-vms
pull: never
resources:
cpu: 6000
memory: 10Gi
environment:
E2E_GOCOVER: 'true'
commands:
- mkdir -p dist/artifacts
- cp /tmp/artifacts/* dist/artifacts/
- |
cd tests/e2e/splitserver
vagrant destroy -f
go test -v -timeout=30m ./splitserver_test.go -ci -local
cp ./coverage.out /tmp/artifacts/split-coverage.out
- |
cd ../token
vagrant destroy -f
go test -v -timeout=30m ./token_test.go -ci -local
cp ./coverage.out /tmp/artifacts/token-coverage.out
volumes:
- name: libvirt
path: /var/run/libvirt/
Expand All @@ -734,17 +708,15 @@ steps:
- name: upload to codecov
image: robertstettner/drone-codecov
depends_on:
- test-e2e-block1
- test-e2e-block2
- test-e2e-block3
- test-block1
- test-block2
settings:
token:
from_secret: codecov_token
files:
- /tmp/artifacts/validate-coverage.out
- /tmp/artifacts/upgrade-coverage.out
- /tmp/artifacts/se-coverage.out
- /tmp/artifacts/snap-coverage.out
- /tmp/artifacts/split-coverage.out
- /tmp/artifacts/token-coverage.out
flags:
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/scripts/cleanup_vms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ for vm in $vms; do
if [[ $vm =~ $time_regex ]]; then
vm_time="${BASH_REMATCH[1]}"
age=$((current_time - vm_time))
if [ $age -gt 7200 ]; then
if [ $age -gt 3600 ]; then
virsh destroy $vm
virsh undefine $vm --remove-all-storage
fi
Expand All @@ -28,7 +28,7 @@ for vm in $vms; do
if [[ $vm =~ $time_regex ]]; then
vm_time="${BASH_REMATCH[1]}"
age=$((current_time - vm_time))
if [ $age -gt 7200 ]; then
if [ $age -gt 3600 ]; then
virsh undefine $vm --remove-all-storage
fi
fi
Expand Down

0 comments on commit 383d84a

Please sign in to comment.