diff --git a/test/e2e/run.bash b/test/e2e/run.bash index 0ba2510d2..cc8822ba0 100755 --- a/test/e2e/run.bash +++ b/test/e2e/run.bash @@ -37,15 +37,21 @@ E2E_KIND_CLUSTER_NUM=${E2E_KIND_CLUSTER_NUM:-1} if ! kubectl version > /dev/null 2>&1; then install_kind + # We require GNU Parallel, but some systems come with Tollef's parallel (moreutils) + if ! parallel -h | grep -q "GNU Parallel"; then + echo "GNU Parallel is not available on your system" + exit 1 + fi + echo '>>> Creating Kind Kubernetes cluster(s)' KIND_CONFIG_PREFIX="${HOME}/.kube/kind-config-${KIND_CLUSTER_PREFIX}" - seq 1 "${E2E_KIND_CLUSTER_NUM}" | time parallel -- env KUBECONFIG="${KIND_CONFIG_PREFIX}-{}" kind create cluster --name "${KIND_CLUSTER_PREFIX}-{}" --wait 5m for I in $(seq 1 "${E2E_KIND_CLUSTER_NUM}"); do defer kind --name "${KIND_CLUSTER_PREFIX}-${I}" delete cluster > /dev/null 2>&1 || true defer rm -rf "${KIND_CONFIG_PREFIX}-${I}" # Wire tests with the right cluster based on their BATS_JOB_SLOT env variable eval export "KUBECONFIG_SLOT_${I}=${KIND_CONFIG_PREFIX}-${I}" done + seq 1 "${E2E_KIND_CLUSTER_NUM}" | time parallel -- env KUBECONFIG="${KIND_CONFIG_PREFIX}-{}" kind create cluster --name "${KIND_CLUSTER_PREFIX}-{}" --wait 5m echo '>>> Loading images into the Kind cluster(s)' seq 1 "${E2E_KIND_CLUSTER_NUM}" | time parallel -- kind --name "${KIND_CLUSTER_PREFIX}-{}" load docker-image 'docker.io/fluxcd/flux:latest'