From 4f2b408c2bbe8d2f1a4f0b901e4e6f5eb5c7ff61 Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Mon, 9 Dec 2024 13:38:56 -0800 Subject: [PATCH] Split E2E Drone pipeline into 2 parallel chunks Signed-off-by: Derek Nola --- .drone.yml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 54482bcaafc6..836ffb367eb5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -604,8 +604,27 @@ steps: - name: docker path: /var/run/docker.sock -- name: test-e2e +# 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 2 groups: +# - validatecluster and secretsencryption +# - splitserver and upgradecluster + +- 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 + - tests/e2e/scripts/cleanup_vms.sh + volumes: + - name: libvirt + path: /var/run/libvirt/ + +- name: test-e2e-block1 image: test-e2e + depends_on: + - cleanup-vms pull: never resources: cpu: 6000 @@ -616,10 +635,8 @@ steps: commands: - mkdir -p dist/artifacts - cp /tmp/artifacts/* dist/artifacts/ - - docker stop registry && docker rm registry - # Cleanup VMs that are older than 2h. Happens if a previous test panics or is canceled - - tests/e2e/scripts/cleanup_vms.sh - - docker run -d -p 5000:5000 -e REGISTRY_PROXY_REMOTEURL=https://registry-1.docker.io --name registry registry:2 + - docker stop registry1 && docker rm registry1 + - docker run -d -p 5000:5000 -e REGISTRY_PROXY_REMOTEURL=https://registry-1.docker.io --name registry1 registry:2 - | cd tests/e2e/validatecluster vagrant destroy -f @@ -630,6 +647,32 @@ steps: vagrant destroy -f go test -v -timeout=30m ./secretsencryption_test.go -ci -local cp ./coverage.out /tmp/artifacts/se-coverage.out + - docker stop registry1 && docker rm registry1 + + volumes: + - name: libvirt + path: /var/run/libvirt/ + - name: docker + path: /var/run/docker.sock + - name: cache + path: /tmp/artifacts + +- name: test-e2e-block2 + image: test-e2e + depends_on: + - cleanup-vms + pull: never + resources: + cpu: 6000 + memory: 10Gi + environment: + E2E_REGISTRY: 'true' + E2E_GOCOVER: 'true' + commands: + - mkdir -p dist/artifacts + - cp /tmp/artifacts/* dist/artifacts/ + - docker stop registry2 && docker rm registry2 + - docker run -d -p 5000:5000 -e REGISTRY_PROXY_REMOTEURL=https://registry-1.docker.io --name registry2 registry:2 - | cd ../splitserver vagrant destroy -f @@ -652,7 +695,7 @@ steps: E2E_RELEASE_CHANNEL=$UPGRADE_CHANNEL go test -v -timeout=45m ./upgradecluster_test.go -ci -local -ginkgo.v cp ./coverage.out /tmp/artifacts/upgrade-coverage.out fi - - docker stop registry && docker rm registry + - docker stop registry2 && docker rm registry2 volumes: - name: libvirt @@ -664,6 +707,9 @@ steps: - name: upload to codecov image: robertstettner/drone-codecov + depends_on: + - test-e2e-block1 + - test-e2e-block2 settings: token: from_secret: codecov_token